Merge pull request #78 from SELab1/authentication

Disable anonymous user
This commit is contained in:
Tibo De Peuter 2023-04-18 14:39:39 +02:00 committed by GitHub Enterprise
commit bd78d74708
2 changed files with 2 additions and 2 deletions

View file

@ -1,3 +1,3 @@
package be.ugent.sel.studeez.data.local.models
data class User(val id: String = "", val isAnonymous: Boolean = true)
data class User(val id: String = "")

View file

@ -39,7 +39,7 @@ class FirebaseAccountDAO @Inject constructor(
get() = callbackFlow {
val listener =
FirebaseAuth.AuthStateListener { auth ->
this.trySend(auth.currentUser?.let { User(it.uid, it.isAnonymous) } ?: User())
this.trySend(auth.currentUser?.let { User(it.uid) } ?: User())
}
auth.addAuthStateListener(listener)
awaitClose { auth.removeAuthStateListener(listener) }