Skip to content

Commit e39b5a8

Browse files
committed
trim username and email input before firing an event to the bus
1 parent 55b6ce2 commit e39b5a8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/src/main/java/com/auth0/android/lock/views/ChangePasswordFormView.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public Object getActionEvent() {
7171

7272
@NonNull
7373
private String getUsernameOrEmail() {
74-
return emailInput.getText();
74+
return emailInput.getText().trim();
7575
}
7676

7777
@Override

lib/src/main/java/com/auth0/android/lock/views/LogInFormView.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ private String getUsername() {
174174
boolean usingDatabase = currentConnection == null && fallbackToDatabase;
175175
boolean usingOAuthEnterprise = currentConnection != null && !currentConnection.isActiveFlowEnabled();
176176
if (usingDatabase || usingOAuthEnterprise) {
177-
return emailInput.getText();
177+
return emailInput.getText().trim();
178178
} else {
179179
//Using RO: we get the Username from the "second screen".
180-
return usernameInput.getText();
180+
return usernameInput.getText().trim();
181181
}
182182
}
183183

lib/src/main/java/com/auth0/android/lock/views/SignUpFormView.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public Object getActionEvent() {
131131

132132
@Nullable
133133
private String getUsername() {
134-
return usernameInput.getVisibility() == VISIBLE ? usernameInput.getText() : null;
134+
return usernameInput.getVisibility() == VISIBLE ? usernameInput.getText().trim() : null;
135135
}
136136

137137
@NonNull
138138
private String getEmail() {
139-
return emailInput.getText();
139+
return emailInput.getText().trim();
140140
}
141141

142142
@NonNull

0 commit comments

Comments
 (0)