import { publicApi } from './http'

export async function fetchEmailVerifyStatus() {
  const { data } = await publicApi.get('/email/verify-status')
  return data
}

export async function generateCaptcha() {
  const { data } = await publicApi.post('/generate_captcha', {})
  return data
}

export async function login(payload) {
  const { data } = await publicApi.post('/login', payload)
  return data
}

export async function register(payload) {
  const { data } = await publicApi.post('/register', payload)
  return data
}

export async function resendVerifyEmail(payload) {
  const { data } = await publicApi.post('/resend-verify-email', payload)
  return data
}

export async function forgotPassword(payload) {
  const { data } = await publicApi.post('/forgot-password', payload)
  return data
}

export async function confirmPasswordReset(payload) {
  const { data } = await publicApi.post('/reset-password-confirm', payload)
  return data
}
