简体   繁体   中英

NextAuth.js Facebook provider

How did you deal with "the email address cannot be returned for accounts created on mobile devices" using NextAuth.js Facebook provider

I need to store user email in DB

If user have not set an email address, email field value will be null in the response. I check the email this way:

  if (user.email === null) {
    throw new Error("Email address is required");
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM