mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-26 05:16:41 +07:00
getting token / error
This commit is contained in:
parent
956802d5a5
commit
dc6f72baf1
26 changed files with 269 additions and 374 deletions
19
src/redux/auth/reducer.ts
Normal file
19
src/redux/auth/reducer.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
import {EMPTY_TOKEN, EMPTY_USER, AUTH_USER_ACTIONS} from "~/redux/auth/constants";
|
||||
import { createReducer } from "~/utils/reducer";
|
||||
import {IAuthState} from "~/redux/auth/types";
|
||||
import {AUTH_USER_HANDLERS} from "~/redux/auth/handlers";
|
||||
|
||||
const HANDLERS = {
|
||||
...AUTH_USER_HANDLERS,
|
||||
};
|
||||
|
||||
const INITIAL_STATE: IAuthState = {
|
||||
token: { ...EMPTY_TOKEN },
|
||||
user: { ...EMPTY_USER },
|
||||
login: {
|
||||
error: null,
|
||||
is_loading: false,
|
||||
},
|
||||
};
|
||||
|
||||
export default createReducer(INITIAL_STATE, HANDLERS);
|
Loading…
Add table
Add a link
Reference in a new issue