1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-05-03 00:26:41 +07:00

getting token / error

This commit is contained in:
muerwre 2019-08-03 12:12:23 +07:00
parent 956802d5a5
commit dc6f72baf1
26 changed files with 269 additions and 374 deletions
src/redux/auth

18
src/redux/auth/actions.ts Normal file
View file

@ -0,0 +1,18 @@
import { AUTH_USER_ACTIONS } from "~/redux/auth/constants";
import {IAuthState, IUser} from "~/redux/auth/types";
export const userSendLoginRequest = ({
username, password
}: {
username: string, password: string
}) => ({ type: AUTH_USER_ACTIONS.SEND_LOGIN_REQUEST, username, password });
export const userSetLoginError = (error: IAuthState['login']['error']) => ({
type: AUTH_USER_ACTIONS.SET_LOGIN_ERROR, error
});
export const authSetToken = (token: IAuthState['token']) => ({
type: AUTH_USER_ACTIONS.SET_TOKEN, token,
});
export const authSetUser = (profile: Partial<IUser>) => ({ type: AUTH_USER_ACTIONS.SET_USER, profile });