import { baseClient } from './base.js';

export const authApi = {
  register(email, password) {
    return baseClient.post('/auth/register', { email, password });
  },

  login(email, password) {
    return baseClient.post('/auth/login', { email, password });
  },

  forgotPassword(email) {
    return baseClient.post('/auth/forgot', { email });
  },

  resetPassword(token, newPassword) {
    return baseClient.post('/auth/reset', { token, newPassword });
  },

  getProfile() {
    return baseClient.get('/auth/profile');
  },

  updateProfile(data) {
    return baseClient.put('/auth/profile', data);
  },

  changePassword(currentPassword, newPassword) {
    return baseClient.post('/auth/change-password', { currentPassword, newPassword });
  },

  resendVerification() {
    return baseClient.post('/auth/resend-verification');
  },

  verifyEmail(token) {
    return baseClient.post('/auth/verify-email', { token });
  },

  deleteAccount(password) {
    return baseClient.delete('/auth/account', { password });
  },

  setToken(token) {
    baseClient.setToken(token);
  },
};
