auth0 / auth0-react

Auth0 SDK for React Single Page Applications (SPA)
MIT License
891 stars 259 forks source link

Different field naming in React and React Native User interface #794

Open XaviPolser opened 2 months ago

XaviPolser commented 2 months ago

Checklist

Description

Hello team! We noticed that users could not log into a React Native app despite being able to access the web. We use a shared User Context Provider between the two in a monorepo setup. While debugging, we noticed that the culprit was a different field naming in the User interface, more specifically, the email verified field. We require users to verify the email to access our application.

I'm attaching a screenshot that showcases the discrepancy:

image

On the left, the React Native types using camelCase, on the right, the React ones using a dash email_verified.

It's not a big deal but it took us a while to find the root cause so I thought we would share it.

Reproduction

  1. Authenticate a user in a vanilla React app and a React Native app.
  2. Console.log the user object.
  3. Notice the different naming in the email verified field.

Additional context

No response

auth0-react version

2.2.4

React version

18.2.0

Which browsers have you tested in?

Chrome, Edge, Safari, Firefox, Opera, Other