import { apiClient } from './apiClient';

export const registerUser = (payload) => apiClient('/auth/register', { method: 'POST', data: payload });

export const loginUser = (payload) => apiClient('/auth/login', { method: 'POST', data: payload });

export const fetchCurrentUser = (token) =>
  apiClient('/auth/me', {
    method: 'GET',
    token,
  });

export const logoutUser = (token) =>
  apiClient('/auth/logout', {
    method: 'POST',
    token,
  });

export const requestPasswordReset = (payload) =>
  apiClient('/auth/forgot-password', {
    method: 'POST',
    data: payload,
  });

export const loginWithGoogle = (accessToken) =>
  apiClient('/auth/oauth', {
    method: 'POST',
    data: { accessToken },
  });
