Adds error throw for LoginActivity LoginMode Unknown

This commit is contained in:
ericdecanini 2022-03-15 15:05:33 +01:00
parent a173accfa5
commit ef59faf160
2 changed files with 165 additions and 163 deletions

View file

@ -67,9 +67,11 @@ internal class DefaultRegistrationWizard(
return performRegistrationRequest(params, LoginType.PASSWORD)
}
override suspend fun createAccount(userName: String?,
override suspend fun createAccount(
userName: String?,
password: String?,
initialDeviceDisplayName: String?): RegistrationResult {
initialDeviceDisplayName: String?
): RegistrationResult {
val params = RegistrationParams(
username = userName,
password = password,

View file

@ -252,7 +252,7 @@ open class LoginActivity : VectorBaseActivity<ActivityLoginBinding>(), UnlockedA
SignMode.SignIn -> {
// It depends on the LoginMode
when (state.loginMode) {
LoginMode.Unknown,
LoginMode.Unknown -> error("Developer error")
is LoginMode.Sso -> launchSsoFlow()
is LoginMode.SsoAndPassword,
LoginMode.Password -> addFragmentToBackstack(views.loginFragmentContainer,