feat: trim username and password fields before login (#1687)

pull/1593/head
ggurdin 9 months ago committed by GitHub
parent 527a835cd2
commit 32ae0fb558
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -153,7 +153,7 @@ class LoginController extends State<Login> {
try { try {
// #Pangea // #Pangea
String username = usernameController.text; String username = usernameController.text.trim();
if (RegExp(r'^@(\w+):').hasMatch(username)) { if (RegExp(r'^@(\w+):').hasMatch(username)) {
username = username =
RegExp(r'^@(\w+):').allMatches(username).elementAt(0).group(1)!; RegExp(r'^@(\w+):').allMatches(username).elementAt(0).group(1)!;
@ -184,7 +184,10 @@ class LoginController extends State<Login> {
user: identifier.type == AuthenticationIdentifierTypes.userId user: identifier.type == AuthenticationIdentifierTypes.userId
? username ? username
: null, : null,
password: passwordController.text, // #Pangea
// password: passwordController.text,
password: passwordController.text.trim(),
// Pangea#
initialDeviceDisplayName: PlatformInfos.clientName, initialDeviceDisplayName: PlatformInfos.clientName,
); );
MatrixState.pangeaController.pStoreService MatrixState.pangeaController.pStoreService

Loading…
Cancel
Save