mirror of
https://github.com/SrIzan10/next-auth.git
synced 2026-05-01 10:55:20 +00:00
fix(providers): optional chaining in azure-ad-b2c profile (#8616)
Fix crash in azure-ad-b2c.ts Not all b2c-setups return a list of emails. This fixes the resulting crash by using defensive access when setting the profile email address field. Co-authored-by: Thang Vu <hi@thvu.dev>
This commit is contained in:
@@ -118,7 +118,7 @@ export default function AzureADB2C(
|
||||
return {
|
||||
id: profile.sub,
|
||||
name: profile.name,
|
||||
email: profile.emails[0],
|
||||
email: profile?.emails?.[0],
|
||||
image: null,
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user