Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thin-camels-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/ui": patch
---

Fixed an issue where primary identifier in OAuth consent screen shows undefined when signing in with phone number only
6 changes: 2 additions & 4 deletions packages/ui/src/components/OAuthConsent/OAuthConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function OAuthConsentInternal() {
const { applicationName, logoImageUrl } = useEnvironment().displayConfig;
const [isUriModalOpen, setIsUriModalOpen] = useState(false);

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

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