Package com.example.examer.auth

Types

Link copied to clipboard
sealed class AuthenticationResult

A sealed class that encapsulates the status of initiating the authentication process.

Link copied to clipboard
interface AuthenticationService

An interface that contains the requisite fields and methods required for an authentication service.

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

A concrete implementation of AuthenticationService that makes use of Firebase.

Functions

Link copied to clipboard
inline fun buildProfileChangeRequest(builderAction: UserProfileChangeRequest.Builder.() -> Unit): UserProfileChangeRequest

Returns a new UserProfileChangeRequest by applying the builderAction to a new instance of UserProfileChangeRequest.

Link copied to clipboard
suspend fun FirebaseUser.changeEmail(newEmail: String, password: String)

Used to change the associated email of a FirebaseUser to the specified newEmail. If a re-authentication is required, then the specified password would be used.

Link copied to clipboard
suspend fun FirebaseUser.changePassword(newPassword: String, oldPassword: String)

Used to change the password of a FirebaseUser to the specified newPassword. If a re-authentication is required, then the value of the specified oldPassword would be used.

Link copied to clipboard
suspend fun FirebaseUser.changePhotoUri(uri: Uri)

Used o change the associated photo uri of a FirebaseUser to the specified uri.

Link copied to clipboard
suspend fun FirebaseUser.changeUserName(newName: String)

Utility method to update the display name of an instance of FirebaseUser with the newName. If any exception occurs, it throws the exception.

Link copied to clipboard
suspend fun FirebaseAuth.createUser(    name: String,     email: String,     password: String,     profilePhotoUri: Uri?): FirebaseUser

This extension method is used for creating a FirebaseUser with the provided name,email,password and profilePhotoUri.

Link copied to clipboard
suspend fun FirebaseUser.runCatchingRecentLoginException(password: String, updateBlock: suspend () -> Unit)

A utility function that executes the given updateBlock and tries to re-run the block if the updateBlock throws a FirebaseAuthRecentLoginRequiredException. If the block throws any other exception, it will be re-thrown.