mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-10-01 15:57:46 +05:30
Fix codestyle
This commit is contained in:
parent
f55700b4ff
commit
d28337cb7f
@ -32,7 +32,7 @@ const changeContextSpringConfig = {stiffness: 500, damping: 20, precision: 0.5};
|
|||||||
* (e.g. the panel with lower index will slide from left side, and with greater from right side)
|
* (e.g. the panel with lower index will slide from left side, and with greater from right side)
|
||||||
*/
|
*/
|
||||||
const contexts = [
|
const contexts = [
|
||||||
['login', 'password', 'mfa', 'forgotPassword', 'recoverPassword'],
|
['login', 'password', 'forgotPassword', 'mfa', 'recoverPassword'],
|
||||||
['register', 'activation', 'resendActivation'],
|
['register', 'activation', 'resendActivation'],
|
||||||
['acceptRules'],
|
['acceptRules'],
|
||||||
['chooseAccount', 'permissions']
|
['chooseAccount', 'permissions']
|
||||||
|
@ -46,6 +46,12 @@ export function redirect(url: string): () => Promise<*> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const PASSWORD_REQUIRED = 'error.password_required';
|
||||||
|
const LOGIN_REQUIRED = 'error.login_required';
|
||||||
|
const ACTIVATION_REQUIRED = 'error.account_not_activated';
|
||||||
|
const TOTP_REQUIRED = 'error.totp_required';
|
||||||
|
|
||||||
export function login({
|
export function login({
|
||||||
login = '',
|
login = '',
|
||||||
password = '',
|
password = '',
|
||||||
@ -57,11 +63,6 @@ export function login({
|
|||||||
totp?: string,
|
totp?: string,
|
||||||
rememberMe?: bool
|
rememberMe?: bool
|
||||||
}) {
|
}) {
|
||||||
const PASSWORD_REQUIRED = 'error.password_required';
|
|
||||||
const LOGIN_REQUIRED = 'error.login_required';
|
|
||||||
const ACTIVATION_REQUIRED = 'error.account_not_activated';
|
|
||||||
const TOTP_REQUIRED = 'error.totp_required';
|
|
||||||
|
|
||||||
return wrapInLoader((dispatch) =>
|
return wrapInLoader((dispatch) =>
|
||||||
authentication.login(
|
authentication.login(
|
||||||
{login, password, totp, rememberMe}
|
{login, password, totp, rememberMe}
|
||||||
@ -86,8 +87,9 @@ export function login({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return validationErrorsHandler(dispatch)(resp);
|
return Promise.reject(resp);
|
||||||
})
|
})
|
||||||
|
.catch(validationErrorsHandler(dispatch))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +510,10 @@ function authHandler(dispatch) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function validationErrorsHandler(dispatch: (Function | Object) => void, repeatUrl?: string) {
|
function validationErrorsHandler(
|
||||||
|
dispatch: (Function | Object) => void,
|
||||||
|
repeatUrl?: string
|
||||||
|
) {
|
||||||
return (resp) => {
|
return (resp) => {
|
||||||
if (resp.errors) {
|
if (resp.errors) {
|
||||||
const firstError = Object.keys(resp.errors)[0];
|
const firstError = Object.keys(resp.errors)[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user