mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
receiving window messages
This commit is contained in:
parent
f7b8b56b53
commit
49bccb96c1
8 changed files with 68 additions and 37 deletions
|
@ -2,17 +2,29 @@ import { AUTH_USER_ACTIONS } from '~/redux/auth/constants';
|
|||
import { IAuthState, IUser } from '~/redux/auth/types';
|
||||
|
||||
export const userSendLoginRequest = ({
|
||||
username, password
|
||||
username,
|
||||
password,
|
||||
}: {
|
||||
username: string; password: string;
|
||||
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
|
||||
type: AUTH_USER_ACTIONS.SET_LOGIN_ERROR,
|
||||
error,
|
||||
});
|
||||
|
||||
export const authSetToken = (token: IAuthState['token']) => ({
|
||||
type: AUTH_USER_ACTIONS.SET_TOKEN, token,
|
||||
type: AUTH_USER_ACTIONS.SET_TOKEN,
|
||||
token,
|
||||
});
|
||||
|
||||
export const authSetUser = (profile: Partial<IUser>) => ({ type: AUTH_USER_ACTIONS.SET_USER, profile });
|
||||
export const gotPostMessage = (message: MessageEvent) => ({
|
||||
type: AUTH_USER_ACTIONS.GOT_POST_MESSAGE,
|
||||
message,
|
||||
});
|
||||
|
||||
export const authSetUser = (profile: Partial<IUser>) => ({
|
||||
type: AUTH_USER_ACTIONS.SET_USER,
|
||||
profile,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue