feat: refactor refresh token handling; update schema and logic for improved security and functionality

This commit is contained in:
2026-01-23 10:45:49 -05:00
parent 35d891bed7
commit ae91108484
8 changed files with 669 additions and 71 deletions
+1 -1
View File
@@ -58,7 +58,7 @@ export async function refreshTokenIfNeeded() {
});
if (res.ok) {
const data = await res.json();
if (data.token.token && data.token.refreshToken && data.token.success) {
if (data.success && data.token?.token && data.token?.refreshToken) {
console.log('Token refreshed successfully');
setTokens(data.token.token, data.token.refreshToken);
} else {