Refactor authentication routes to use '/auth' prefix in API calls
All checks were successful
Chore App Build and Push Docker Images / build-and-push (push) Successful in 38s

This commit is contained in:
2026-02-17 10:38:40 -05:00
parent 7e7a2ef49e
commit 5e22e5e0ee
17 changed files with 78 additions and 33 deletions

View File

@@ -263,7 +263,7 @@ async function resetPassword() {
resetting.value = true
errorMsg.value = ''
try {
const res = await fetch('/api/request-password-reset', {
const res = await fetch('/api/auth/request-password-reset', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: initialData.value.email }),
@@ -295,7 +295,6 @@ function closeDeleteWarning() {
}
async function confirmDeleteAccount() {
console.log('Confirming delete account with email:', confirmEmail.value)
if (!isEmailValid(confirmEmail.value)) return
deletingAccount.value = true
@@ -332,8 +331,15 @@ async function confirmDeleteAccount() {
function handleDeleteSuccess() {
showDeleteSuccess.value = false
logoutUser()
router.push('/auth/login')
// Call logout API to clear server cookies
fetch('/api/auth/logout', {
method: 'POST',
credentials: 'include',
}).finally(() => {
// Clear client-side auth and redirect, regardless of logout response
logoutUser()
router.push('/auth/login')
})
}
function closeDeleteError() {