Swift Cannot read properties of undefined (reading 'passwordless_method') while trying to login using email and password

Hello everyone,

I have been facing an issue while implementing Auth0 with a username and password authentication method. Every time I try to log in, the login fails, and I receive the following error message: “Cannot read properties of undefined (reading ‘passwordless_method’)”. Additionally, the status code returned is 500.

Here is the code snippet I am using for the login process:

Auth0
    .authentication()
    .login(
        usernameOrEmail: "pratik@engrossinfotech.com",
        password: "xxx@12345",
        realmOrConnection: "Username-Password-Authentication",
        audience: "https://example.us.auth0.com/api/v2/",
        scope: "openid profile email offline_access"
    )
    .start { result in
        switch result {
        case .failure(let error):
            print(error.localizedDescription)
        case .success(let credentials):
            print(credentials)
        }
    }

Note:
– Version: Release 2.3.2 · auth0/Auth0.swift · GitHub
– Mac M2 and M1
– I have also tested the login functionality using WebAuth, and it worked without any issues.
– I have also allowed the Password in the Grant Types.

Any guidance or suggestions on resolving this issue would be greatly appreciated.

Thank you.

Hey there!

In order to handle that most effectively I highly encourage you to file it as a GitHub issue in the repo you referenced:

Once you do that please share the link to it here so we can work on that directly with the repo maintainers. Thank you!

Thank you @konrad.sopala

Here is the link: Swift Cannot read properties of undefined (reading ‘passwordless_method’) · Issue #770 · auth0/Auth0.swift · GitHub

1 Like

Perfect! Thank you I’ll ping repo maintainers in a few minutes!

1 Like

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