mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-17 00:52:50 +05:30
#218: do not write username into email field, because it may break logic of some features
This commit is contained in:
parent
8f51ef3273
commit
14f096a45f
@ -19,9 +19,18 @@ export function login({login = '', password = '', rememberMe = false}) {
|
||||
.catch((resp) => {
|
||||
if (resp.errors) {
|
||||
if (resp.errors.password === PASSWORD_REQUIRED) {
|
||||
let username = '';
|
||||
let email = '';
|
||||
|
||||
if (/[@.]/.test(login)) {
|
||||
email = login;
|
||||
} else {
|
||||
username = login;
|
||||
}
|
||||
|
||||
return dispatch(updateUser({
|
||||
username: login,
|
||||
email: login
|
||||
username,
|
||||
email
|
||||
}));
|
||||
} else if (resp.errors.login === ACTIVATION_REQUIRED) {
|
||||
return dispatch(needActivation());
|
||||
|
Loading…
x
Reference in New Issue
Block a user