mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-26 19:08:44 +03:00
Adds custom and direct login types
This commit is contained in:
parent
70b5b9855a
commit
ae540297b1
4 changed files with 8 additions and 2 deletions
|
@ -98,7 +98,7 @@ internal class DefaultLoginWizard(
|
|||
authAPI.login(data)
|
||||
}
|
||||
|
||||
return sessionCreator.createSession(credentials, pendingSessionData.homeServerConnectionConfig, LoginType.UNSUPPORTED)
|
||||
return sessionCreator.createSession(credentials, pendingSessionData.homeServerConnectionConfig, LoginType.CUSTOM)
|
||||
}
|
||||
|
||||
override suspend fun resetPassword(email: String, newPassword: String) {
|
||||
|
|
|
@ -77,7 +77,7 @@ internal class DefaultDirectLoginTask @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
return sessionCreator.createSession(credentials, params.homeServerConnectionConfig, LoginType.UNSUPPORTED)
|
||||
return sessionCreator.createSession(credentials, params.homeServerConnectionConfig, LoginType.DIRECT)
|
||||
}
|
||||
|
||||
private fun buildClient(homeServerConnectionConfig: HomeServerConnectionConfig): OkHttpClient {
|
||||
|
|
|
@ -20,6 +20,8 @@ enum class LoginType(val value: String) {
|
|||
PASSWORD("password"),
|
||||
SSO("sso"),
|
||||
UNSUPPORTED("unsupported"),
|
||||
CUSTOM("custom"),
|
||||
DIRECT("direct"),
|
||||
UNKNOWN("unknown");
|
||||
|
||||
companion object {
|
||||
|
@ -28,6 +30,8 @@ enum class LoginType(val value: String) {
|
|||
PASSWORD.value -> PASSWORD
|
||||
SSO.value -> SSO
|
||||
UNSUPPORTED.value -> UNSUPPORTED
|
||||
CUSTOM.value -> CUSTOM
|
||||
DIRECT.value -> DIRECT
|
||||
else -> UNKNOWN
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ class LoginTypeTest {
|
|||
LoginType.fromValue(LoginType.PASSWORD.value) shouldBeEqualTo LoginType.PASSWORD
|
||||
LoginType.fromValue(LoginType.SSO.value) shouldBeEqualTo LoginType.SSO
|
||||
LoginType.fromValue(LoginType.UNSUPPORTED.value) shouldBeEqualTo LoginType.UNSUPPORTED
|
||||
LoginType.fromValue(LoginType.CUSTOM.value) shouldBeEqualTo LoginType.CUSTOM
|
||||
LoginType.fromValue(LoginType.DIRECT.value) shouldBeEqualTo LoginType.DIRECT
|
||||
LoginType.fromValue(LoginType.UNKNOWN.value) shouldBeEqualTo LoginType.UNKNOWN
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue