UserDataViewModel

class UserDataViewModel(application: Application) : AndroidViewModel

Properties

_email
Link copied to clipboard
private var _email: MutableLiveData<String>
email address of the user.
_firstname
Link copied to clipboard
private var _firstname: MutableLiveData<String>
Fistname of the user.
_lastname
Link copied to clipboard
private var _lastname: MutableLiveData<String>
Lastname of the user.
_password
Link copied to clipboard
private val _password: MutableLiveData<String>
Default passwort which will be sent to server with every registration request.
_passwordBeforeNextTask
Link copied to clipboard
private val _passwordBeforeNextTask: MutableLiveData<Boolean>
Indicates whether sendPassword method already finished.
_registeringKey
Link copied to clipboard
private val _registeringKey: MutableLiveData<Boolean>
_sendingPassword
Link copied to clipboard
private val _sendingPassword: MutableLiveData<Boolean>
_sendingUsername
Link copied to clipboard
private val _sendingUsername: MutableLiveData<Boolean>
_signInKey
Link copied to clipboard
private val _signInKey: MutableLiveData<Boolean>
_signInReady
Link copied to clipboard
private val _signInReady: MutableLiveData<Boolean>
Indicates whether signInResponse already completed and suceeded.
_username
Link copied to clipboard
private var _username: MutableLiveData<String>
Username created by the user.
_usernameBeforePassword
Link copied to clipboard
private val _usernameBeforePassword: MutableLiveData<Boolean>
Used to ensure that the sendPassword method is called after sendUsername method
email
Link copied to clipboard
val email: LiveData<String>
firstname
Link copied to clipboard
val firstname: LiveData<String>
lastname
Link copied to clipboard
val lastname: LiveData<String>
password
Link copied to clipboard
private val password: LiveData<String>
passwordBeforeNextTask
Link copied to clipboard
val passwordBeforeNextTask: LiveData<Boolean>
registeringKey
Link copied to clipboard
val registeringKey: LiveData<Boolean>
repository
Link copied to clipboard
private val repository: AuthRepository
sendingPassword
Link copied to clipboard
val sendingPassword: LiveData<Boolean>
sendingUsername
Link copied to clipboard
val sendingUsername: LiveData<Boolean>
signInKey
Link copied to clipboard
val signInKey: LiveData<Boolean>
signInReady
Link copied to clipboard
val signInReady: LiveData<Boolean>
username
Link copied to clipboard
val username: LiveData<String>
usernameBeforePassword
Link copied to clipboard
val usernameBeforePassword: LiveData<Boolean>

Inherited properties

mApplication
Link copied to clipboard
private val mApplication: Application
mBagOfTags
Link copied to clipboard
private val mBagOfTags: MutableMap<String, Any>?
mCleared
Link copied to clipboard
private val mCleared: Boolean

Functions

getFullName
Link copied to clipboard
fun getFullName(): String
Concatenate _firstname and _lastname to create full name.
registerRequest
Link copied to clipboard
fun registerRequest(): LiveData<PendingIntent?>
Send a request to server to register a new FIDO2 key for current user.
registerResponse
Link copied to clipboard
fun registerResponse(intentData: Intent)
Send result from the FIDO2 register intent to the server to complete the registration of the FIDO2 key.
sendPassword
Link copied to clipboard
fun sendPassword()
Send default password to FIDO2 server.
sendUsername
Link copied to clipboard
fun sendUsername()
Send to and register created username on FIDO2 server.
setData
Link copied to clipboard
fun setData(fn: String, ln: String, email: String)
Store personal user data for registration process.
setFido2ApiClient
Link copied to clipboard
fun setFido2ApiClient(fidoClient: Fido2ApiClient?)
Setup FIDO2 clientUse repository to setup FIDO2 client.
setPasswordBeforeNextTask
Link copied to clipboard
fun setPasswordBeforeNextTask()
Reset _passwordBeforeNextTask after sending all data.
setSignInKey
Link copied to clipboard
fun setSignInKey()
Reset _signInKey to false.
setUsername
Link copied to clipboard
fun setUsername(uname: String)
Store username created by user.
setUsernameBeforePassword
Link copied to clipboard
fun setUsernameBeforePassword()
Reset _usernameBeforePassword after sending username and password to login.
signInRequest
Link copied to clipboard
fun signInRequest(): LiveData<PendingIntent?>
Send request to server to sign in into member area with current username.
signInResponse
Link copied to clipboard
fun signInResponse(intentData: Intent)
Send the response from the login intent to the server to complete the login process.
signOut
Link copied to clipboard
fun signOut()
Used by MainActivity to prevent multiple users being in signingIn state at once
signOutOnErrorOrFinished
Link copied to clipboard
fun signOutOnErrorOrFinished()
Once registration is finished and the user decides to go back to RegisterLoginFragment, he/she will be signed out and all local data from the registration process will be deleted.

Inherited functions

clear
Link copied to clipboard
fun clear()
getApplication
Link copied to clipboard
open fun <T : Application> getApplication(): T
getTag
Link copied to clipboard
open fun <T : Any> getTag(p0: String): T
onCleared
Link copied to clipboard
open fun onCleared()
setTagIfAbsent
Link copied to clipboard
open fun <T : Any> setTagIfAbsent(p0: String, p1: T): T