mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-27 11:28:33 +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)
|
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) {
|
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 {
|
private fun buildClient(homeServerConnectionConfig: HomeServerConnectionConfig): OkHttpClient {
|
||||||
|
|
|
@ -20,6 +20,8 @@ enum class LoginType(val value: String) {
|
||||||
PASSWORD("password"),
|
PASSWORD("password"),
|
||||||
SSO("sso"),
|
SSO("sso"),
|
||||||
UNSUPPORTED("unsupported"),
|
UNSUPPORTED("unsupported"),
|
||||||
|
CUSTOM("custom"),
|
||||||
|
DIRECT("direct"),
|
||||||
UNKNOWN("unknown");
|
UNKNOWN("unknown");
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -28,6 +30,8 @@ enum class LoginType(val value: String) {
|
||||||
PASSWORD.value -> PASSWORD
|
PASSWORD.value -> PASSWORD
|
||||||
SSO.value -> SSO
|
SSO.value -> SSO
|
||||||
UNSUPPORTED.value -> UNSUPPORTED
|
UNSUPPORTED.value -> UNSUPPORTED
|
||||||
|
CUSTOM.value -> CUSTOM
|
||||||
|
DIRECT.value -> DIRECT
|
||||||
else -> UNKNOWN
|
else -> UNKNOWN
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,8 @@ class LoginTypeTest {
|
||||||
LoginType.fromValue(LoginType.PASSWORD.value) shouldBeEqualTo LoginType.PASSWORD
|
LoginType.fromValue(LoginType.PASSWORD.value) shouldBeEqualTo LoginType.PASSWORD
|
||||||
LoginType.fromValue(LoginType.SSO.value) shouldBeEqualTo LoginType.SSO
|
LoginType.fromValue(LoginType.SSO.value) shouldBeEqualTo LoginType.SSO
|
||||||
LoginType.fromValue(LoginType.UNSUPPORTED.value) shouldBeEqualTo LoginType.UNSUPPORTED
|
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
|
LoginType.fromValue(LoginType.UNKNOWN.value) shouldBeEqualTo LoginType.UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue