Skip to content

Commit c37899e

Browse files
committed
chore(clerk-js): Show phone number instead of undefined in OAuth consent screen
1 parent 833b325 commit c37899e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

packages/ui/src/components/OAuthConsent/OAuthConsent.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function OAuthConsentInternal() {
2525
const { applicationName, logoImageUrl } = useEnvironment().displayConfig;
2626
const [isUriModalOpen, setIsUriModalOpen] = useState(false);
2727

28-
const primaryEmailAddress = user?.emailAddresses.find(email => email.id === user.primaryEmailAddress?.id);
28+
const primaryIdentifier = user?.primaryEmailAddress?.emailAddress || user?.primaryPhoneNumber?.phoneNumber;
2929

3030
// Filter out offline_access from displayed scopes as it doesn't describe what can be accessed
3131
const displayedScopes = (scopes || []).filter(item => item.scope !== OFFLINE_ACCESS_SCOPE);
@@ -106,9 +106,7 @@ export function OAuthConsentInternal() {
106106
</ConnectionHeader>
107107
)}
108108
<Header.Title localizationKey={oAuthApplicationName} />
109-
<Header.Subtitle
110-
localizationKey={`wants to access ${applicationName} on behalf of ${primaryEmailAddress}`}
111-
/>
109+
<Header.Subtitle localizationKey={`wants to access ${applicationName} on behalf of ${primaryIdentifier}`} />
112110
</Header.Root>
113111
<Box
114112
sx={t => ({

0 commit comments

Comments
 (0)