Files
DoC/frontend/src/services/authService.js
T
2026-04-13 14:04:53 +02:00

18 lines
524 B
JavaScript

import api from '../lib/api';
export const authService = {
login: async (email, password) => {
const response = await api.post('/auth/login', { email, password });
return response.data;
},
register: async (username, email, password) => {
const response = await api.post('/auth/register', { username, email, password });
return response.data;
},
getCurrentUser: async () => {
const response = await api.get('/auth/me');
return response.data;
}
};