Changes login types in wizards

This commit is contained in:
ericdecanini 2022-03-04 20:58:30 +01:00
parent bb2369dad2
commit bcd802d335
2 changed files with 8 additions and 8 deletions

View file

@ -90,7 +90,7 @@ internal class DefaultLoginWizard(
authAPI.login(loginParams) authAPI.login(loginParams)
} }
return sessionCreator.createSession(credentials, pendingSessionData.homeServerConnectionConfig, LoginType.UNSUPPORTED) return sessionCreator.createSession(credentials, pendingSessionData.homeServerConnectionConfig, LoginType.SSO)
} }
override suspend fun loginCustom(data: JsonDict): Session { override suspend fun loginCustom(data: JsonDict): Session {

View file

@ -64,7 +64,7 @@ internal class DefaultRegistrationWizard(
override suspend fun getRegistrationFlow(): RegistrationResult { override suspend fun getRegistrationFlow(): RegistrationResult {
val params = RegistrationParams() val params = RegistrationParams()
return performRegistrationRequest(params, LoginType.UNSUPPORTED) return performRegistrationRequest(params, LoginType.PASSWORD)
} }
override suspend fun createAccount(userName: String?, override suspend fun createAccount(userName: String?,
@ -87,7 +87,7 @@ internal class DefaultRegistrationWizard(
?: throw IllegalStateException("developer error, call createAccount() method first") ?: throw IllegalStateException("developer error, call createAccount() method first")
val params = RegistrationParams(auth = AuthParams.createForCaptcha(safeSession, response)) val params = RegistrationParams(auth = AuthParams.createForCaptcha(safeSession, response))
return performRegistrationRequest(params, LoginType.UNSUPPORTED) return performRegistrationRequest(params, LoginType.PASSWORD)
} }
override suspend fun acceptTerms(): RegistrationResult { override suspend fun acceptTerms(): RegistrationResult {
@ -95,7 +95,7 @@ internal class DefaultRegistrationWizard(
?: throw IllegalStateException("developer error, call createAccount() method first") ?: throw IllegalStateException("developer error, call createAccount() method first")
val params = RegistrationParams(auth = AuthParams(type = LoginFlowTypes.TERMS, session = safeSession)) val params = RegistrationParams(auth = AuthParams(type = LoginFlowTypes.TERMS, session = safeSession))
return performRegistrationRequest(params, LoginType.UNSUPPORTED) return performRegistrationRequest(params, LoginType.PASSWORD)
} }
override suspend fun addThreePid(threePid: RegisterThreePid): RegistrationResult { override suspend fun addThreePid(threePid: RegisterThreePid): RegistrationResult {
@ -145,14 +145,14 @@ internal class DefaultRegistrationWizard(
.also { pendingSessionStore.savePendingSessionData(it) } .also { pendingSessionStore.savePendingSessionData(it) }
// and send the sid a first time // and send the sid a first time
return performRegistrationRequest(params, LoginType.UNSUPPORTED) return performRegistrationRequest(params, LoginType.PASSWORD)
} }
override suspend fun checkIfEmailHasBeenValidated(delayMillis: Long): RegistrationResult { override suspend fun checkIfEmailHasBeenValidated(delayMillis: Long): RegistrationResult {
val safeParam = pendingSessionData.currentThreePidData?.registrationParams val safeParam = pendingSessionData.currentThreePidData?.registrationParams
?: throw IllegalStateException("developer error, no pending three pid") ?: throw IllegalStateException("developer error, no pending three pid")
return performRegistrationRequest(safeParam, LoginType.UNSUPPORTED, delayMillis) return performRegistrationRequest(safeParam, LoginType.PASSWORD, delayMillis)
} }
override suspend fun handleValidateThreePid(code: String): RegistrationResult { override suspend fun handleValidateThreePid(code: String): RegistrationResult {
@ -173,7 +173,7 @@ internal class DefaultRegistrationWizard(
if (validationResponse.isSuccess()) { if (validationResponse.isSuccess()) {
// The entered code is correct // The entered code is correct
// Same than validate email // Same than validate email
return performRegistrationRequest(registrationParams, LoginType.UNSUPPORTED, 3_000) return performRegistrationRequest(registrationParams, LoginType.PASSWORD, 3_000)
} else { } else {
// The code is not correct // The code is not correct
throw Failure.SuccessError throw Failure.SuccessError
@ -185,7 +185,7 @@ internal class DefaultRegistrationWizard(
?: throw IllegalStateException("developer error, call createAccount() method first") ?: throw IllegalStateException("developer error, call createAccount() method first")
val params = RegistrationParams(auth = AuthParams(type = LoginFlowTypes.DUMMY, session = safeSession)) val params = RegistrationParams(auth = AuthParams(type = LoginFlowTypes.DUMMY, session = safeSession))
return performRegistrationRequest(params, LoginType.UNSUPPORTED) return performRegistrationRequest(params, LoginType.PASSWORD)
} }
private suspend fun performRegistrationRequest( private suspend fun performRegistrationRequest(