From fff54763a08140937dc97ef527534218e03e6f19 Mon Sep 17 00:00:00 2001 From: Shreyas2004wagh Date: Mon, 9 Feb 2026 11:01:30 +0530 Subject: [PATCH 1/2] fix(auth): propagate secure token request errors --- packages/auth/src/utils/tokenRequestHandler.ts | 1 + packages/react/src/lib/auth.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/auth/src/utils/tokenRequestHandler.ts b/packages/auth/src/utils/tokenRequestHandler.ts index 9e6c7dc5eb..0fff84c266 100644 --- a/packages/auth/src/utils/tokenRequestHandler.ts +++ b/packages/auth/src/utils/tokenRequestHandler.ts @@ -24,5 +24,6 @@ export async function tokenRequestHandler( return response.json(); } catch (error) { console.error(`Error with ${method} request:`, error); + throw error; } } diff --git a/packages/react/src/lib/auth.js b/packages/react/src/lib/auth.js index c3ac9ca586..17fc5ecee3 100644 --- a/packages/react/src/lib/auth.js +++ b/packages/react/src/lib/auth.js @@ -18,7 +18,7 @@ async function deleteTokenLocalStorage() { } async function saveTokenSecure(token) { - this.handleSecureLogin('save', token); + return await this.handleSecureLogin('save', token); } async function getTokenSecure() { @@ -27,7 +27,7 @@ async function getTokenSecure() { } async function deleteTokenSecure() { - this.handleSecureLogin('delete'); + return await this.handleSecureLogin('delete'); } export function getTokenStorage(secure = false) { From 79513d00096079cadd7f71ccd963e0102ef7f31d Mon Sep 17 00:00:00 2001 From: Shreyas2004wagh Date: Mon, 9 Feb 2026 11:18:14 +0530 Subject: [PATCH 2/2] chore(react): remove redundant return await in auth helpers --- packages/react/src/lib/auth.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react/src/lib/auth.js b/packages/react/src/lib/auth.js index 17fc5ecee3..9d1068a9e3 100644 --- a/packages/react/src/lib/auth.js +++ b/packages/react/src/lib/auth.js @@ -18,7 +18,7 @@ async function deleteTokenLocalStorage() { } async function saveTokenSecure(token) { - return await this.handleSecureLogin('save', token); + return this.handleSecureLogin('save', token); } async function getTokenSecure() { @@ -27,7 +27,7 @@ async function getTokenSecure() { } async function deleteTokenSecure() { - return await this.handleSecureLogin('delete'); + return this.handleSecureLogin('delete'); } export function getTokenStorage(secure = false) {