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:
Joachim Bjørge
2023-09-24 05:01:43 +02:00
committed by GitHub
parent a96dcdbca3
commit a5ac491cb8

View File

@@ -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,
}
},