Feature - Login integration (#7)

* Added: formik and validation schema

* Added: Validation schema

* Added: logout test integration

* Added: Enter key to submit

* Added: incorrect password error message

* Removed: logger

* Updated: logout initial state

Co-authored-by: Llewellyn D'souza <lledsouza2209@gmail.com>
Jira ticket ref: WMS-27
This commit is contained in:
bluestreamlds
2022-01-20 10:08:50 +05:30
committed by GitHub
parent f8f47ae983
commit f7a0bf64f2
5 changed files with 97 additions and 295 deletions

View File

@@ -49,9 +49,12 @@ export const onLoginFailure = (state, { error }) =>
error: { ...state.error, [error?.loader]: error?.error }
});
export const onLogout = () => INITIAL_STATE;
/* ------------- Hookup Reducers To Types ------------- */
export const authReducer = createReducer(INITIAL_STATE, {
[Types.LOGIN_REQUEST]: onLoginRequest,
[Types.LOGIN_SUCCESS]: onLoginSuccess,
[Types.LOGIN_FAILURE]: onLoginFailure
[Types.LOGIN_FAILURE]: onLoginFailure,
[Types.LOGOUT]: onLogout
});