mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
Merge pull request #6094 from vector-im/feature/adm/ftue-avoid-resetting-login-state
SDK - Avoid resetting login state when calling `AuthenticationService.getLoginFlow`
This commit is contained in:
commit
b6b487dfa0
3 changed files with 4 additions and 10 deletions
1
changelog.d/6093.sdk
Normal file
1
changelog.d/6093.sdk
Normal file
|
@ -0,0 +1 @@
|
|||
Allowing AuthenticationService.getLoginFlow to fail without resetting state from previously successful calls
|
|
@ -28,9 +28,11 @@ import org.matrix.android.sdk.api.session.Session
|
|||
* This interface defines methods to authenticate or to create an account to a matrix server.
|
||||
*/
|
||||
interface AuthenticationService {
|
||||
|
||||
/**
|
||||
* Request the supported login flows for this homeserver.
|
||||
* This is the first method to call to be able to get a wizard to login or to create an account
|
||||
* This is the first method to call to be able to get a wizard to login or to create an account.
|
||||
* @param homeServerConnectionConfig contains the homeserver URL to login to, a wellKnown lookup will be attempted.
|
||||
*/
|
||||
suspend fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig): LoginFlowResult
|
||||
|
||||
|
|
|
@ -130,16 +130,7 @@ internal class DefaultAuthenticationService @Inject constructor(
|
|||
?.trim { it == '/' }
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the entry point of the authentication service.
|
||||
* homeServerConnectionConfig contains a homeserver URL probably entered by the user, which can be a
|
||||
* valid homeserver API url, the url of Element Web, or anything else.
|
||||
*/
|
||||
override suspend fun getLoginFlow(homeServerConnectionConfig: HomeServerConnectionConfig): LoginFlowResult {
|
||||
pendingSessionData = null
|
||||
|
||||
pendingSessionStore.delete()
|
||||
|
||||
val result = runCatching {
|
||||
getLoginFlowInternal(homeServerConnectionConfig)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue