Silently accept usernames in front of instances in the login screen, because plenty of folks try including it.

This commit is contained in:
Vavassor 2017-04-06 21:16:40 -04:00
parent 632cb0d6e3
commit bfc89b26bd
1 changed files with 6 additions and 0 deletions

View File

@ -78,8 +78,14 @@ public class LoginActivity extends AppCompatActivity {
/** Make sure the user-entered text is just a fully-qualified domain name. */
private static String validateDomain(String s) {
// Strip any schemes out.
s = s.replaceFirst("http://", "");
s = s.replaceFirst("https://", "");
// If a username was included (e.g. username@example.com), just take what's after the '@'.
int at = s.indexOf('@');
if (at != -1) {
s = s.substring(at + 1);
}
return s.trim();
}