Spaces:
Sleeping
Sleeping
File size: 608 Bytes
4bae792 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | import api from "./api";
export const authService = {
// Login
login: (credentials) => api.post("/auth/login", credentials),
// Register
register: (data) => api.post("/auth/register", data),
// Logout
logout: () => api.post("/auth/logout"),
// Refresh token
refreshToken: (refreshToken) => api.post("/auth/refresh", { refreshToken }),
// Get current user profile
getProfile: () => api.get("/auth/profile"),
// Update profile
updateProfile: (data) => api.patch("/auth/profile", data),
// Change password
changePassword: (data) => api.post("/auth/change-password", data),
};
|