Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c53d659b authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

App lounge: (issue_5168) modify DataStoreModule.destroyCredentials() to not remove USERTYPE

parent 04de8602
Loading
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -64,12 +64,18 @@ class DataStoreModule @Inject constructor(
        }
    }

    /**
     * Destroy auth credentials if they are no longer valid.
     *
     * Modification for issue: https://gitlab.e.foundation/e/backlog/-/issues/5168
     * Previously this method would also remove [USERTYPE].
     * But now it is only to be done from [saveUserType] passing [User.UNAVAILABLE] when clicking logout.
     */
    suspend fun destroyCredentials() {
        context.dataStore.edit {
            it.remove(AUTHDATA)
            it.remove(EMAIL)
            it.remove(OAUTHTOKEN)
            it.remove(USERTYPE)
        }
    }