bbuddy-ui/src/actions/auth.ts

15 lines
394 B
TypeScript

import { apiRequest } from './helpers';
export const getAuth = (locale: string, data: { login: string, password: string }): Promise<{ jwtToken: string }> => apiRequest({
url: '/auth/login',
method: 'post',
data,
locale
});
export const getRegister = (locale: string): Promise<{ jwtToken: string }> => apiRequest({
url: '/auth/register',
method: 'post',
locale
});