You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
430 B
20 lines
430 B
import api from './index';
|
|
|
|
export interface LoginData {
|
|
username: string;
|
|
password: string;
|
|
}
|
|
|
|
export interface RegisterData {
|
|
username: string;
|
|
password: string;
|
|
email?: string;
|
|
}
|
|
|
|
export const authApi = {
|
|
login: (data: LoginData) => api.post('/auth/login', data),
|
|
register: (data: RegisterData) => api.post('/auth/register', data),
|
|
logout: () => api.post('/auth/logout'),
|
|
getMe: () => api.get('/auth/me')
|
|
};
|
|
|
|
|