diff --git a/changelog.d/7111.misc b/changelog.d/7111.misc new file mode 100644 index 0000000000..bb6d4ac689 --- /dev/null +++ b/changelog.d/7111.misc @@ -0,0 +1 @@ +Add trim to username input on the app side and SDK side when sign-in diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt index 468e998407..0a8c58de16 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/auth/login/DefaultLoginWizard.kt @@ -69,7 +69,7 @@ internal class DefaultLoginWizard( ) } else { PasswordLoginParams.userIdentifier( - user = login, + user = login.trim(), password = password, deviceDisplayName = initialDeviceName, deviceId = deviceId diff --git a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt index 79d06a0864..585597ab01 100644 --- a/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/login/LoginViewModel.kt @@ -684,7 +684,7 @@ class LoginViewModel @AssistedInject constructor( currentJob = viewModelScope.launch { try { safeLoginWizard.login( - action.username, + action.username.trim(), action.password, action.initialDeviceName )