timetracker update
This commit is contained in:
@@ -46,7 +46,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
const data = await useFetchJson<AuthResponse>('/api/v1/auth/login', {
|
||||
const data = await useFetchJson<AuthResponse>('/api/v1/public/auth/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email, password }),
|
||||
@@ -81,7 +81,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
try {
|
||||
await useFetchJson('/api/v1/auth/register', {
|
||||
await useFetchJson('/api/v1/public/auth/register', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ first_name, last_name, email, password, confirm_password, lang: lang || 'en' }),
|
||||
@@ -101,7 +101,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
await useFetchJson('/api/v1/auth/forgot-password', {
|
||||
await useFetchJson('/api/v1/public/auth/forgot-password', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email }),
|
||||
@@ -121,7 +121,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
await useFetchJson('/api/v1/auth/reset-password', {
|
||||
await useFetchJson('/api/v1/public/auth/reset-password', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ token, password }),
|
||||
@@ -137,7 +137,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
}
|
||||
|
||||
function loginWithGoogle() {
|
||||
window.location.href = '/api/v1/auth/google'
|
||||
window.location.href = '/api/v1/public/auth/google'
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
*/
|
||||
async function logout() {
|
||||
try {
|
||||
await useFetchJson('/api/v1/auth/logout', {
|
||||
await useFetchJson('/api/v1/public/auth/logout', {
|
||||
method: 'POST',
|
||||
})
|
||||
} catch {
|
||||
@@ -167,7 +167,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
*/
|
||||
async function refreshAccessToken(): Promise<boolean> {
|
||||
try {
|
||||
await useFetchJson('/api/v1/auth/refresh', {
|
||||
await useFetchJson('/api/v1/public/auth/refresh', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
// No body needed — the backend reads the refresh_token from the HTTPOnly cookie
|
||||
|
||||
Reference in New Issue
Block a user