mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 12:56:41 +07:00
auth
This commit is contained in:
parent
56d714d655
commit
e0bba90d2e
12 changed files with 264 additions and 89 deletions
|
@ -7,8 +7,7 @@ import {
|
|||
} from '~/utils/api';
|
||||
import { API } from '~/constants/api';
|
||||
import { IResultWithStatus } from '~/redux/types';
|
||||
import { authMeTransform, userLoginTransform } from '~/redux/auth/transforms';
|
||||
import { IUser } from '~/redux/auth/types';
|
||||
import { userLoginTransform } from '~/redux/auth/transforms';
|
||||
|
||||
export const apiUserLogin = ({
|
||||
username,
|
||||
|
@ -22,10 +21,3 @@ export const apiUserLogin = ({
|
|||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware)
|
||||
.then(userLoginTransform);
|
||||
|
||||
export const getAuthSelf = ({ access }): Promise<IResultWithStatus<{ user: IUser }>> =>
|
||||
api
|
||||
.get(API.USER.ME, configWithToken(access))
|
||||
.then(resultMiddleware)
|
||||
.catch(errorMiddleware)
|
||||
.then(authMeTransform);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue