Server-side currentUser email

I’m using Auth0 for authentication. I’m trying to find field. I want to save this email for potential future migration. It looks like the object does not have the email field. Here’s an example data for currentUser:

  iss: '',
  sub: 'auth0|5ee53543e4647b00137025dd',
  aud: [
  iat: 1592079735,
  exp: 1592166135,
  azp: 'RFI3tsaUePpAMtVv9u3Td07eejT6BTiL',
  scope: 'openid profile email'

I see the email field in currentUser on the client-side, but not the server-side. How do I retrieve it on the server-side?

You can add it to the jwt by using Auth0’s rules as described over here:

We should probably add this to the Redwood’s Auth docs!


@peterp thanks very much. I figured it out now. It is confusing as the rule needs to be added inside Auth0 Auth Pipeline. I was trying to add it into getCurrentUser function. :slight_smile:


Potentially related with a different take on the setup (just fyi):

1 Like