FirebaseAuthenticationService

class FirebaseAuthenticationService(defaultDispatcher: CoroutineDispatcher = Dispatchers.IO) : AuthenticationService

A concrete implementation of AuthenticationService that makes use of Firebase.

Constructors

Link copied to clipboard
fun FirebaseAuthenticationService(defaultDispatcher: CoroutineDispatcher = Dispatchers.IO)

Functions

Link copied to clipboard
open suspend override fun createAccount(    username: String,     email: String,     password: String,     profilePhotoUri: Uri?): AuthenticationResult

Used to create a new user account with the provided username, email,password and an optional profilePhotoUri. An instance of AuthenticationResult will be returned to indicate whether an account was successfully created or not.

Link copied to clipboard
open suspend override fun signIn(email: String, password: String): AuthenticationResult

Used to sign in a user with the provided email and password. An instance of AuthenticationResult will be returned to indicate a successful or failed sign-in attempt.

Link copied to clipboard
open override fun signOut()

Used to sign out the current user.

Link copied to clipboard
open suspend override fun updateAttributeForUser(user: ExamerUser, updateAttribute: AuthenticationService.UpdateAttribute): AuthenticationResult

Used to update an attribute of the specified user. The UpdateAttribute param of the function will be used to specify the attribute to update. An instance of AuthenticationResult will be returned to indicate whether the update was successful.

Properties

Link copied to clipboard
open override val currentUser: LiveData<ExamerUser?>

The current user represents the user that is currently logged in. If it is null, it implies that there is no logged in user.