Sudden Email Passwordless Authentication Failure in Local Environment

Hello Auth0 Community,

I’ve recently encountered a sudden issue with email passwordless authentication in my local development environment. Specifically, the email passwordless authentication has failed entirely. Additionally, when I attempt to use Google authentication, it enters an infinite refresh loop after I approve the 2-factor authentication through the Gmail client.

Here are a few things to note:

  1. I toggled between “development” and “production” modes in the Auth0 dashboard before this issue occurred. I’m not certain if this could have led to some configuration changes that affect the authentication process.
  2. Now, even when the authentication seems to succeed, I’m not receiving any tokens as expected. However, I do see successful authentication logs (log details below).
  3. Interestingly, I have the same application running in production, and it works fine without any of these issues.

Logs:

{
  "date": "2024-01-06T02:56:10.610Z",
  "type": "fepotpft",
  "description": "Wrong email or verification code.",
  "connection": "email",
  "connection_id": "con_0ID1u9fWiQRE91NO",
  "client_id": "",
  "client_name": "Sweenk",
  "ip": "",
  "client_ip": "-",
  "user_agent": "SweenkDEV 36.0.0 / Other 0.0.0",
  "hostname": "sweenk.us.auth0.com",
  "user_id": "",
  "user_name": "l*******a@gmail.com",
  "audience": "***",
  "scope": "openid email profile",
  "auth0_client": {
    "name": "react-native-auth0",
    "version": "2.17.2"
  },
  "log_id": "90020240106025610724172000000000000001223372043601153609",
  "_id": "90020240106025610724172000000000000001223372043601153609",
  "isMobile": false,
  "id": "90020240106025610724172000000000000001223372043601153609"
}
{
  "date": "2024-01-06T04:19:12.484Z",
  "type": "sepft",
  "description": "Password for Access Token",
  "connection": "email",
  "connection_id": "con_0ID1u9fWiQRE91NO",
  "client_id": "",
  "client_name": "Sweenk",
  "ip": "",
  "client_ip": "",
  "user_agent": "SweenkDEV 36.0.0 / Other 0.0.0",
  "details": {
    "actions": {
      "executions": [
        "*"
      ]
    }
  },
  "user_id": "email|6598d4add0cd986e3010638f",
  "user_name": "l*****a@sweenk.com",
  "audience": "",
  "scope": "openid email profile read:newsfeed",
  "auth0_client": {
    "name": "react-native-auth0",
    "version": "2.17.2"
  },
  "log_id": "90020240106041912560263000000000000001223372043602641705",
  "_id": "90020240106041912560263000000000000001223372043602641705",
  "isMobile": false,
  "id": "90020240106041912560263000000000000001223372043602641705"
}

I’ve double-checked configurations and tried reverting back to previous states, but the issue persists. I’m at a loss for what might be causing this sudden change in behavior and would greatly appreciate any insights or suggestions from the community.

Has anyone else experienced something similar, or does anyone have suggestions on what might be going wrong or what I should check next?

Thank you in advance for your help!

P.S. - At production passwordless auth works, but social auths stoped working properly

Hi @lasharela,

Welcome to the Auth0 Community!

Are you seeing any information on the client side? What is happening with the “infinite loop”? i.e. what requests are occurring infinitely.

Also, what SDK and versions are you using? Is it only the one application?

@dan.woda
Thanks for replay.

or the email login issue, it resolved itself. I checked with a real device, and then the next day with an emulator - both are working.

LinkedIn - works. The only remaining problem is with Twitter:

  1. First of all, the login screen I see doesn’t appear to be mobile-adapted. See the attached screenshot.

However, after logging in, it shows me the next screen (this screen is more mobile-friendly)

  1. But main problem - after final authentication, I’m getting no error which I can catch (auth is successful) but credentials are empty. (Something wrong with my Action I guess)

SDK: “react-native-auth0”: “^3.1.0”

Here is my implementation:

const audience = "https://aucience-here";

const signinParameter: WebAuthorizeParameters = {
  scope: "openid profile email",
  audience,
};

const signinOptions: WebAuthorizeOptions = {
  ephemeralSession: true,
};
...

 const authenticate = async (connection: string) => {
    try {
      const credentials = await authorize(
        {
          ...signinParameter,
          connection,
        },
        signinOptions
      );
      if (credentials) {
        modifyOneSignalUser(credentials);
      }
      return credentials;
    } catch (error) {
      console.error(`Error during ${connection} login:`, error);
    }
  };

...
  const onLinkedInAuth = () => authenticate("linkedin");
  const onXLogin = () => authenticate("twitter");
  const onGoogleAuth = () => authenticate("google-oauth2");

Interesting is that, when I’m trying with the same account but from the oAuth0 dashboard (try Twitter), I’m getting following: Please verify your email before logging in. which comes from my action, where I don’t allow to login without validated email.

exports.onExecutePostLogin = async (event, api) => {
    if (!event.user.email_verified) {
        api.access.deny('Please verify your email before logging in.');
    }

    if (!event.user.email) {
        api.access.deny('The user has no email associated with the account.');
    }
};

lost :slight_smile:

P.S. An interesting detail - when I tried using a username instead of an email for Twitter authentication, the extra (mobile-friendly) screen did not appear, but the error remained the same.

This is a page owned by X/Twitter, and Auth0 doesn’t have control over it’s styling unfortunately.

If you turn off your Action do you still see the issue?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.