From 90d665250f9eee08da9768e3b133ace31a18cc3b Mon Sep 17 00:00:00 2001 From: mohiit1502 Date: Mon, 26 Jan 2026 19:04:10 +0530 Subject: [PATCH] Revert "fix(getUser): prefer stored userinfo over ID token for username claim" This reverts commit f51f5c8148acfe74f8ef363860b9190c0383f8aa. --- src/client.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/client.ts b/src/client.ts index 5976b12..0cab965 100644 --- a/src/client.ts +++ b/src/client.ts @@ -329,21 +329,9 @@ export class StuffleIAMClient { } /** - * Get current user from stored userinfo or ID token - * Prefers stored userinfo (from fetchUserInfo) as it has more claims like username + * Get current user from stored ID token */ getUser(): User | null { - // First try stored userinfo (has username and other claims from /userinfo endpoint) - const storedUser = this.storage.get(STORAGE_KEYS.USER); - if (storedUser) { - try { - return JSON.parse(storedUser) as User; - } catch { - // Fall through to ID token - } - } - - // Fallback to ID token (may not have all claims like username) const idToken = this.storage.get(STORAGE_KEYS.ID_TOKEN); if (!idToken) return null;