timetracker update

This commit is contained in:
Daniel Goc
2026-03-11 09:33:36 +01:00
parent bbf8a2c133
commit 9ef4bb219b
121 changed files with 4328 additions and 2231 deletions

View File

@@ -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