Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to sign up #885

Closed
4 tasks done
bruno-barros opened this issue Jan 8, 2024 · 5 comments
Closed
4 tasks done

Unable to sign up #885

bruno-barros opened this issue Jan 8, 2024 · 5 comments

Comments

@bruno-barros
Copy link

Checklist

  • I have looked into the Readme and the documentation, and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Description

After migrating to verision 5.0 I'm unable to register/create a new user. O Auth0 logs panel a see the error "Unexpected token < in JSON at position 0".
Could it be related to the "Database Action Scripts"?
On the Auth0 panel I get the same error trying out the scripts for login and getUser.

Reproduction

  1. Access the login page
  2. Click on Register
  3. Input the user register fields

Additional context

No response

wp-auth0 version

5.0

WordPress version

6.4

PHP version

8.0

@bruno-barros
Copy link
Author

I can not find any reference on the Auth0 plugin to the action /index.php?a0_action=migration-ws-get-user.
Is it required to the sing up process?

@bruno-barros
Copy link
Author

Maybe I'm getting too far on this, but I implemented a function to respond properly when Auth0 call the site with the a0_action argument.

if(isset($_GET['a0_action']) && $_GET['a0_action'] == 'migration-ws-get-user'){
     $this->migrateUser();
}

Then I just respond with a proper JSON to do not break the Auth0 connection with my custom database.
Probably I'm doing unessessary work, but as I have an old Auth0 configuration and the plugin do not respond on this Auth0 request, this did the job.

@evansims
Copy link
Member

evansims commented Jan 9, 2024

Hi @bruno-barros,

After migrating to verision 5.0 I'm unable to register/create a new user. O Auth0 logs panel a see the error "Unexpected token < in JSON at position 0".

Where exactly are you seeing this error? Please walk me through what are you attempting to do when it occurs.

Could it be related to the "Database Action Scripts"?

I don't follow, can you clarify what you mean? Are you referring to Auth0 Actions setup on the service side?

On the Auth0 panel I get the same error trying out the scripts for login and getUser.

Do you mean the error is displayed inside the WordPress admin dashboard, or your Auth0 management log? What scripts are you referring to? v5 does not have a log panel in the WordPress admin dashboard.

I can not find any reference on the Auth0 plugin to the action /index.php?a0_action=migration-ws-get-user.

"a0_action" is a v4 API, and wouldn't have any relevance to v5. It isn't supported by v5. Can you clarify what your environment is set up with right now, v4 or v5?

@bruno-barros
Copy link
Author

bruno-barros commented Jan 9, 2024

Hi @evansims hummmm ok. I'm starting to see the problem here.
On the Auth0 admin panel: "Authentication > Database > Custom database > Database Action Scripts" there are two javascript snipets. One to log user in and the second to get user data from the site database.
You just said that "a0_action" is deprecated on v5, but as I have these scripts running on the Auth0 panel, every time an user try to login in or sign up these scripts runs sending a request to the site backend.
If these request do not respond with a proper valid JSON the Auth0 sign up just fails.

// Auth0 log
{
  "date": "2024-01-08T23:29:37.304Z",
  "type": "fs",
  "description": "Unexpected token < in JSON at position 0",
  "connection": "db-abs-rio-production",
  "connection_id": "con_4UoJUe7byuiyyAkWcf",
  "client_id": "0w3--------------------oZ",
  "client_name": "ABS-Rio",
  "ip": "2804:1b3:6d03:814a:9525:73c3:3378:b54f",
  "user_agent": "Chrome 120.0.0 / Windows 10.0.0",
  ...
}

Maybe on v5 I don't need to use the "Custon database" configuration. As I started using Auth0 on v4.1, this was required at that time.
Can you confirm this?

Your responses:

Where exactly are you seeing this error? Please walk me through what are you attempting to do when it occurs.

This error I can see on Auth0 logs and on the Custom Database panel were there is a button to try the connection out.

Do you mean the error is displayed inside the WordPress admin dashboard, or your Auth0 management log? What scripts are you referring to? v5 does not have a log panel in the WordPress admin dashboard.

All the errors appears on Auth0 Logs.

"a0_action" is a v4 API, and wouldn't have any relevance to v5. It isn't supported by v5. Can you clarify what your environment is set up with right now, v4 or v5?

As I said, I was on v4 and migrated to v5. Now I see that I'm using a feature of v4 but with the code of v5. Because of that a needed to respond the request with "a0_action" argument.

Now I'm afraid that a need to disable the "Custom Database" feature on the Auth0 panel.

@evansims
Copy link
Member

evansims commented Jan 9, 2024

Maybe on v5 I don't need to use the "Custon database" configuration. As I started using Auth0 on v4.1, this was required at that time.
Can you confirm this?

Ah, gotcha, thanks for clarifying — no, v5 does not require any special custom database configuration, and I would expect having such will almost certainly break things. Thanks for raising that, I'll add it to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants