Refactored store
This commit is contained in:
@ -1,16 +1,19 @@
|
||||
import axios from "axios";
|
||||
import axiosInstance from "../http/axiosInstance";
|
||||
|
||||
export default class AuthService {
|
||||
static async hello() {
|
||||
return await axios.get(`${import.meta.env.VITE_API_AUTH_URL}/hello`)
|
||||
static async login(data: any) {
|
||||
return await axiosInstance.post(`/auth/login`, data, {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
static async getUsers() {
|
||||
return await axiosInstance.get(`/auth/user`)
|
||||
static async refreshToken(token: string) {
|
||||
return await axiosInstance.post(`/auth/refresh_token/${token}`)
|
||||
}
|
||||
|
||||
static async getCurrentUser(token: string){
|
||||
static async getCurrentUser(token: string) {
|
||||
return await axiosInstance.get(`/auth/get_current_user/${token}`)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user