mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-27 23:40:28 +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)
|
||||
*/
|
||||
const contexts = [
|
||||
['login', 'password', 'mfa', 'forgotPassword', 'recoverPassword'],
|
||||
['login', 'password', 'forgotPassword', 'mfa', 'recoverPassword'],
|
||||
['register', 'activation', 'resendActivation'],
|
||||
['acceptRules'],
|
||||
['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({
|
||||
login = '',
|
||||
password = '',
|
||||
@ -57,11 +63,6 @@ export function login({
|
||||
totp?: string,
|
||||
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) =>
|
||||
authentication.login(
|
||||
{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) => {
|
||||
if (resp.errors) {
|
||||
const firstError = Object.keys(resp.errors)[0];
|
||||
|
Loading…
Reference in New Issue
Block a user