Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,17 @@ open class AuthenticatorActivity :
return createAccount(result)
}

val existingLoginName = account?.let { AccountUtils.getUsernameForAccount(it) }
if (existingLoginName != null && !existingLoginName.equals(webViewUser, ignoreCase = true)) {
Log_OC.w(TAG, "Account: login name does not match ${account?.name}, credentials not updated")
authStatus = AuthenticatorStatus(
R.drawable.ic_alert,
getString(R.string.auth_login_name_mismatch, existingLoginName)
)
showAuthStatus()
return false
}

return try {
updateAccountAuthentication()
true
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@
<string name="auth_unsupported_multiaccount">%1$s does not support multiple accounts</string>
<string name="auth_fail_get_user_name">Your server is not returning a correct user ID, please contact an admin.</string>
<string name="auth_account_does_not_exist">The account is not added on this device yet</string>
<string name="auth_login_name_mismatch">Log in with %1$s to update this account</string>
<string name="auth_access_failed">Access failed: %1$s</string>

<string name="authenticator_activity_empty_response_message">Unable to fetch login details. Please try again.</string>
Expand Down
Loading