File size: 703 Bytes
6aa6081
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309c40b
 
 
 
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
26
import api from './api'

export async function login(email: string, password: string) {
  const { data } = await api.post('/auth/login', { email, password })
  return data
}

export async function getMe() {
  const { data } = await api.get('/auth/me')
  return data
}

export async function adminResetPassword(userId: number) {
  const { data } = await api.post(`/auth/admin-reset-password/${userId}`)
  return data
}

export async function changePassword(token: string, newPassword: string) {
  const { data } = await api.post('/auth/reset-password', { token, new_password: newPassword })
  return data
}

export async function acknowledgePurge(): Promise<void> {
  await api.post('/auth/ack-purge')
}