From de7636f8520920755d4fae867ec052aae9118ed6 Mon Sep 17 00:00:00 2001 From: Claw AI Date: Sat, 28 Mar 2026 16:31:27 +0000 Subject: [PATCH] Fix token key mismatch in verify functions AuthService stores token as 'auth_token', but verifyEmail/verifyPhone were reading 'token'. Now uses AuthService.getToken() consistently. --- app/utils/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/utils/api.js b/app/utils/api.js index 2592365..e6c3fbb 100644 --- a/app/utils/api.js +++ b/app/utils/api.js @@ -268,13 +268,13 @@ export async function sendPhoneOTP() { export async function verifyEmail(code) { console.log('[Auth] Verifying email with code:', code); - const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null; + const token = AuthService.getToken(); return authFetch(`/Auth/VerifyEmail?code=${encodeURIComponent(code)}`, {}, token); } export async function verifyPhone(code) { console.log('[Auth] Verifying phone with code:', code); - const token = typeof window !== 'undefined' ? localStorage.getItem('token') : null; + const token = AuthService.getToken(); return authFetch(`/Auth/VerifyPhoneNumber?code=${encodeURIComponent(code)}`, {}, token); }