renable login after fail attempt (#4552)
Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
parent
4c31527832
commit
92f941a54c
7 changed files with 16 additions and 2 deletions
|
@ -87,6 +87,10 @@ const Login = ({ state, description }: LoginProps) => {
|
||||||
openActivateAccountDialog();
|
openActivateAccountDialog();
|
||||||
}, ServerTypes.ACCOUNT_AWAITING_ACTIVATION, []);
|
}, ServerTypes.ACCOUNT_AWAITING_ACTIVATION, []);
|
||||||
|
|
||||||
|
useReduxEffect(() => {
|
||||||
|
resetSubmitButton();
|
||||||
|
}, [ServerTypes.LOGIN_FAILED], []);
|
||||||
|
|
||||||
useReduxEffect(({ options: { hashedPassword } }) => {
|
useReduxEffect(({ options: { hashedPassword } }) => {
|
||||||
if (hostIdToRemember) {
|
if (hostIdToRemember) {
|
||||||
HostDTO.get(hostIdToRemember).then(host => {
|
HostDTO.get(hostIdToRemember).then(host => {
|
||||||
|
|
|
@ -41,8 +41,6 @@ const LoginForm = ({ onSubmit, disableSubmitButton, onResetPassword }: LoginForm
|
||||||
setPasswordLabel(useStoredLabel ? STORED_PASSWORD_LABEL : PASSWORD_LABEL);
|
setPasswordLabel(useStoredLabel ? STORED_PASSWORD_LABEL : PASSWORD_LABEL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form onSubmit={onSubmit} validate={validate}>
|
<Form onSubmit={onSubmit} validate={validate}>
|
||||||
{({ handleSubmit, form }) => {
|
{({ handleSubmit, form }) => {
|
||||||
|
|
|
@ -11,6 +11,9 @@ export const Actions = {
|
||||||
type: Types.LOGIN_SUCCESSFUL,
|
type: Types.LOGIN_SUCCESSFUL,
|
||||||
options
|
options
|
||||||
}),
|
}),
|
||||||
|
loginFailed: () => ({
|
||||||
|
type: Types.LOGIN_FAILED,
|
||||||
|
}),
|
||||||
connectionClosed: reason => ({
|
connectionClosed: reason => ({
|
||||||
type: Types.CONNECTION_CLOSED,
|
type: Types.CONNECTION_CLOSED,
|
||||||
reason
|
reason
|
||||||
|
|
|
@ -9,6 +9,9 @@ export const Dispatch = {
|
||||||
loginSuccessful: options => {
|
loginSuccessful: options => {
|
||||||
store.dispatch(Actions.loginSuccessful(options));
|
store.dispatch(Actions.loginSuccessful(options));
|
||||||
},
|
},
|
||||||
|
loginFailed: () => {
|
||||||
|
store.dispatch(Actions.loginFailed());
|
||||||
|
},
|
||||||
connectionClosed: reason => {
|
connectionClosed: reason => {
|
||||||
store.dispatch(Actions.connectionClosed(reason));
|
store.dispatch(Actions.connectionClosed(reason));
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
export const Types = {
|
export const Types = {
|
||||||
CLEAR_STORE: '[Server] Clear Store',
|
CLEAR_STORE: '[Server] Clear Store',
|
||||||
LOGIN_SUCCESSFUL: '[Server] Login Successful',
|
LOGIN_SUCCESSFUL: '[Server] Login Successful',
|
||||||
|
LOGIN_FAILED: '[Server] Login Failed',
|
||||||
CONNECTION_CLOSED: '[Server] Connection Closed',
|
CONNECTION_CLOSED: '[Server] Connection Closed',
|
||||||
SERVER_MESSAGE: '[Server] Server Message',
|
SERVER_MESSAGE: '[Server] Server Message',
|
||||||
UPDATE_BUDDY_LIST: '[Server] Update Buddy List',
|
UPDATE_BUDDY_LIST: '[Server] Update Buddy List',
|
||||||
|
|
|
@ -116,6 +116,7 @@ export class SessionCommands {
|
||||||
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, `Login failed: unknown error: ${raw.responseCode}`);
|
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, `Login failed: unknown error: ${raw.responseCode}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SessionPersistence.loginFailed();
|
||||||
SessionCommands.disconnect();
|
SessionCommands.disconnect();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,10 @@ export class SessionPersistence {
|
||||||
ServerDispatch.loginSuccessful(options);
|
ServerDispatch.loginSuccessful(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static loginFailed() {
|
||||||
|
ServerDispatch.loginFailed();
|
||||||
|
}
|
||||||
|
|
||||||
static connectionClosed(reason: number) {
|
static connectionClosed(reason: number) {
|
||||||
ServerDispatch.connectionClosed(reason);
|
ServerDispatch.connectionClosed(reason);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue