I’ve enabled default Username-Password-Authentication and can’t make it work.
POST /dbconnections/signup
returns
{ "name":"SandboxUnhandledError", "message":"auth0 is not defined", "fromSandbox":true, "stack":"ReferenceError: auth0 is not defined\n at connection.name (/data/io/2130cb1d-0410-401c-9359-15f0881edba4/webtask.js:6:150)\n at /data/io/2130cb1d-0410-401c-9359-15f0881edba4/webtask.js:6:333\n at Async.waterfall.Errors.create.code (/data/sandbox/lib/sandbox.js:558:33)\n at nextTask (/data/sandbox/node_modules/async/dist/async.js:5310:14)\n at next (/data/sandbox/node_modules/async/dist/async.js:5317:9)\n at /data/sandbox/node_modules/async/dist/async.js:958:16\n at /data/sandbox/lib/sandbox.js:447:24\n at nextTask (/data/sandbox/node_modules/async/dist/async.js:5310:14)\n at next (/data/sandbox/node_modules/async/dist/async.js:5317:9)\n at /data/sandbox/node_modules/async/dist/async.js:958:16" }
I’ve tried to disable all rules but it’s not helping. Seems to be some internal error.
Typically, this error will occur when a script in one of your rules, database scripts or hooks makes use of the auth0
object without it being defined first. Since you mention that you’re using the default Username-Password-Authentication (with Use my own database
disabled) and that you’ve disabled all rules, you can also check your [hooks] (https://manage.auth0.com/#/hooks), specifically the “Pre User Registration” and “Post User Registration” will run on the /dbconnections/signup
case.
I have only one hook and it does not use auth0 variable. I’ve dissabled it too but it still return the error
Here is the signup link
Could you share a snippet of code from your authentication request?
No snippet at all, even if I go to connections → database and click try there is the same error on auth0 hosted page
This is the url:
MoonMail Dashboard profile&state=zi_q2Lcu5p2CVmcFlqFK2nNtsp-FH_XK
The problem persists, and even hosted page with default config returns the same error.
Is there anything I can do?
Hosted Page Login
The problem persists, and even hosted page with default config returns the same error.
Is there anything I can do?
Hosted Page Login
@dmitriy.nevzorov Are you getting this issue in the moonmail tenant? Do you see any logs in the dashboard when you call /dbconnections/signup and get this error back?
Yes, it is in moonmail tenant.
This is an error from Webtask Logs
{
"code": 500,
"error": "Script generated an unhandled synchronous exception.",
"details": "ReferenceError: auth0 is not defined",
"name": "ReferenceError",
"message": "auth0 is not defined",
"stack": "ReferenceError: auth0 is not defined\n at connection.name (/data/io/5f5ac665-f16e-47a8-b77d-2d0b775029a5/webtask.js:6:150)\n at /data/io/5f5ac665-f16e-47a8-b77d-2d0b775029a5/webtask.js:6:333\n at Async.waterfall.Errors.create.code (/data/sandbox/lib/sandbox.js:558:33)\n at nextTask (/data/sandbox/node_modules/async/dist/async.js:5310:14)\n at next (/data/sandbox/node_modules/async/dist/async.js:5317:9)\n at /data/sandbox/node_modules/async/dist/async.js:958:16\n at /data/sandbox/lib/sandbox.js:447:24\n at nextTask (/data/sandbox/node_modules/async/dist/async.js:5310:14)\n at next (/data/sandbox/node_modules/async/dist/async.js:5317:9)\n at /data/sandbox/node_modules/async/dist/async.js:958:16"
}
I’ve tried all possible ways to locate the email but it seems to be somewhere on auth0 side. We never used db connection in moonmail so maybe something got broken with internal upgrades?
@dmitriy.nevzorov This seems to indicate a problem with the rules, hooks or custom database scripts. I’ve seen that you have a auth0.users.updateAppMetadata
in your rules. Just to confirm if the issue is with that object, could you try disabling all rules and hooks, enable the Username-Password-Authentication connection for a client and then triggering the hosted login page with Auth0.js for that client?
I’ve tried it multiple times and just did it again right now. The issue persists. Maybe there are some hidden rules or hooks I cant see?
It appears that you have a user_registration
rule in your tenant, probably set a long time ago. This stage has been deprecated in favour of the new hooks. You should remove this rule using the [DELETE /api/v2/rules/{id}] (Auth0 Management API v2).
You can get the rule id by performing a (GET) request to /api/v2/rules?stage=user_registration
, as shown in this community post: Rules for user registration not retrieved via management API - Auth0 Community
Finally, this is it! Thank you very much!