From 53245ca662827c7cfac33f0d9af3b8f4148fe853 Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Sat, 13 Sep 2025 17:38:45 -0400 Subject: [PATCH] Fix profile extraction - sub parameter contains the profile object, extract ID from sub.id --- backend/src/auth.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/src/auth.js b/backend/src/auth.js index 98058d2b..b2e41960 100644 --- a/backend/src/auth.js +++ b/backend/src/auth.js @@ -85,13 +85,13 @@ function configureAuth(app) { console.log('Profile:', profile); console.log('Access Token:', accessToken ? 'Present' : 'Missing'); - // Extract user info from profile - console.log('Raw profile object:', JSON.stringify(profile, null, 2)); + // Extract user info from profile - sub is actually the profile object in this case + console.log('Raw profile object:', JSON.stringify(sub, null, 2)); const userProfile = { - sub: sub, // Use the sub parameter directly - email: profile.emails?.[0]?.value, - name: profile.displayName || profile.name?.givenName || profile.username + sub: sub.id, // Extract the actual ID from the sub object + email: sub.emails?.[0]?.value, + name: sub.displayName || sub.name?.givenName || sub.username }; console.log('Extracted user profile:', userProfile);