mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Re-use FlexiAPI token until it is consumed by account creation
This commit is contained in:
parent
85a904e173
commit
b220d979bd
1 changed files with 10 additions and 1 deletions
|
|
@ -291,7 +291,13 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
|
|||
@UiThread
|
||||
fun requestToken() {
|
||||
coreContext.postOnCoreThread {
|
||||
requestFlexiApiToken()
|
||||
if (accountCreator.token == null) {
|
||||
Log.i("$TAG We don't have a creation token, let's request one")
|
||||
requestFlexiApiToken()
|
||||
} else {
|
||||
Log.i("$TAG We've already have a token [${accountCreator.token}], continuing")
|
||||
checkUsername()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -359,6 +365,9 @@ class AccountCreationViewModel @UiThread constructor() : ViewModel(), CountryPic
|
|||
if (status != AccountCreator.Status.RequestOk) {
|
||||
Log.e("$TAG Can't create account [$status]")
|
||||
operationInProgress.postValue(false)
|
||||
} else {
|
||||
Log.i("$TAG createAccount consumed our token, setting it to null")
|
||||
accountCreator.token = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue