Unverified Commit 64fbce64 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #1236 from RocketChat/fix/login-with-ldap

[FIX] Login with LDAP
parents c1506bc8 b108cff9
...@@ -268,16 +268,15 @@ class LoginPresenter @Inject constructor( ...@@ -268,16 +268,15 @@ class LoginPresenter @Inject constructor(
val token = retryIO("login") { val token = retryIO("login") {
when (loginType) { when (loginType) {
TYPE_LOGIN_USER_EMAIL -> { TYPE_LOGIN_USER_EMAIL -> {
if (usernameOrEmail.isEmail()) { when {
client.loginWithEmail(usernameOrEmail, password) settings.isLdapAuthenticationEnabled() ->
} else {
if (settings.isLdapAuthenticationEnabled()) {
client.loginWithLdap(usernameOrEmail, password) client.loginWithLdap(usernameOrEmail, password)
} else { usernameOrEmail.isEmail() ->
client.loginWithEmail(usernameOrEmail, password)
else ->
client.login(usernameOrEmail, password) client.login(usernameOrEmail, password)
} }
} }
}
TYPE_LOGIN_CAS -> { TYPE_LOGIN_CAS -> {
delay(3, TimeUnit.SECONDS) delay(3, TimeUnit.SECONDS)
client.loginWithCas(credentialToken) client.loginWithCas(credentialToken)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment