File tree Expand file tree Collapse file tree
packages/ui/src/components/OAuthConsent Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " @clerk/ui " : patch
3+ ---
4+
5+ Fixed an issue where primary identifier in OAuth consent screen shows undefined when signing in with phone number only
Original file line number Diff line number Diff 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 => ( {
You can’t perform that action at this time.
0 commit comments