wire auth api
This commit is contained in:
parent
9e70fae38d
commit
eff7c5c281
12 changed files with 137 additions and 19 deletions
|
|
@ -20,7 +20,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||
isSubmitting.value = true
|
||||
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/login`, {
|
||||
const response = await fetch(`${API_BASE_URL}/api/login`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
|
|
@ -46,7 +46,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||
|
||||
async function fetchUser(): Promise<void> {
|
||||
try {
|
||||
const response = await fetch(`${API_BASE_URL}/me`, {
|
||||
const response = await fetch(`${API_BASE_URL}/api/me`, {
|
||||
credentials: 'include',
|
||||
})
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ export const useAuthStore = defineStore('auth', () => {
|
|||
|
||||
async function logout(): Promise<void> {
|
||||
try {
|
||||
await fetch(`${API_BASE_URL}/logout`, {
|
||||
await fetch(`${API_BASE_URL}/api/logout`, {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue