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

Error - auth0 cannot find node with id "auth0-login-form" #483

Closed
hesperanca opened this issue Jun 8, 2018 · 10 comments
Closed

Error - auth0 cannot find node with id "auth0-login-form" #483

hesperanca opened this issue Jun 8, 2018 · 10 comments
Assignees
Milestone

Comments

@hesperanca
Copy link

After upgrading from 3.5.2 to 3.6.1 the authentication page throws a js error saying "auth0 cannot find node with id "auth0-login-form" and it redirect me to the standard WP login page. The same was hapenning with version 3.6.0.

I may be missing something but had to revert back to 3.5.2 to get it working again.

Cheers for all your help.

image

@joshcanhelp joshcanhelp self-assigned this Jun 8, 2018
@joshcanhelp
Copy link
Contributor

Hi @hesperanca ... sorry for the trouble here. You said:

the authentication page

Are you talking about wp-login.php? That error is saying that it doesn't have anywhere to put the Lock form (it's looking for a node with an id attribute of auth0-login-form). That's always output with the core plugin so I'm not sure what's going wrong.

Do you have any relevant customizations at all?

@hesperanca
Copy link
Author

Hi Josh,

Thanks for your reply.

Sorry, yes I'm talking about wp-login.php. As far as I know there are no customisations to the login process. If I revert back to 3.5.2 all is fine. As soon as I upgrade I start to get the error.

I'm relatively new to WordPress so there may be something I'm doing wrong but I cannot see what it could be.

Thanks for your help.

@joshcanhelp
Copy link
Contributor

Thanks for the extra information here.

I just spun up a fresh test install and tried a few options and could not replicate this. Can I have you check a few more things, please?

  • Does the Auth0 plugin error log show anything that looks relevant?
  • Do you have anything in you Auth0 Settings > Appearance tab > Login Form CSS/JS field? Or in Auth0 Settings > Advanced tab > Extra Settings field?
  • Do you have a dev/test clone that we upgrade and debug? Just need a site that you can test the upgrade on while your main site remains on the older version. If you're able to share a URL to that site, it would be helpful (you can send it privately if you don't want the URL out there).

Thank you!

@hesperanca
Copy link
Author

Hi Josh,

Thanks for looking into this.

Here are the answers to your questions:

  • Nope. There are no relevant errors on the Auth0 plugin error log.
  • Both settings are empty.
  • Unfortunately, it's all running on my local dev environment which means I cannot give you access. I was testing the upgrade locally before deploying it to our test environment (which is available over the internet). I can give you access to the test environment but that has the old plugin and I cannot upgrade that one because it's being used by our test team.

Sorry I cannot be more helpful.

Thanks for the help once again.

@joshcanhelp
Copy link
Contributor

So, let's walk through all the WP basics here:

  • Deactivate all plugins that aren't Auth0 and switch to a default theme. Does the problem persist?
  • Deactivate and delete the plugin, then reinstall (don't run the Setup Wizard, just use the same domain, Client ID, and Client Secret). Does the problem persist?

I forgot to ask earlier ... when you upgrade and load wp-login.php, you get the error but does the page have a login form at all? And when it redirects, does it redirect to the same page with ?wle on the URL?

@joshcanhelp
Copy link
Contributor

@hesperanca - Any updates here? I have another issue I'll need to fix and release, would be glad to get a fix in for this if the root cause in on our end.

@hesperanca
Copy link
Author

Hi Josh,

Sorry been away from the office all day today. Just tried switching from the third party theme we were using to one of the default themes and it has started to work. Strange thing is that version 3.5.2 of the auth0 plugin works fine with the third party theme. I'll have a look at the theme code to see if I can find the reason for the conflict and let you know my findings.

Thanks for all the help.

Regards,
Hugo

@joshcanhelp
Copy link
Contributor

Thanks for the update, @hesperanca. Let me know as soon as you're able, happy to add this to an upcoming patch release if it's an issue on our end.

One thing to note ... we did add a filter to the login form output so you can adjust how the form is output, shown here:

https://github.com/auth0/wp-auth0/blob/master/templates/login-form.php#L39

Documented here:

https://auth0.com/docs/cms/wordpress/extending#auth0_login_form_tpl

I'm sure that your theme isn't using that filter but it might helpful figure out the root cause.

Also, if that theme is open source and you can provide a link, I'm happy to take a look and see if I can figure out what's going on.

Thanks!

@joshcanhelp joshcanhelp added this to the v3-Next milestone Jun 14, 2018
@hesperanca
Copy link
Author

Hi Josh,

Thanks for the info. Although the theme isn't using that filter your comments made me look into other filters you are using and I found that you are using the 'login_message' filter to render the form:
image

and the theme code is also using the same filter in this way:
image

Which, based on my limited WP understanding, clears whatever other plugins use on that filter. What I cannot understan is why it was working before and not working now ( unless is something todo with the order that the filters run).

So I think the best option for me would be to create a completelly new login page using your shortcode. This way we bypass all of these issues.

I have another question\issue but it's completelly different from this one so I'll open a new issue.

Thanks for your help and all the great work with this plugin.

Hugo

@joshcanhelp
Copy link
Contributor

Good find! Yes, that filter will run after our filter (11 is later than 5 in runtime) and clear everything out. But, like you said, that doesn't explain why it changed after the update. Version 3.5.2 uses 5 as well:

https://github.com/auth0/wp-auth0/blob/3.5.2/WP_Auth0.php#L60

What you can do, instead of creating a whole new page, is to remove their filter:

remove_filter( 'login_message', `wpjobster_custom_login_form_message`, 11 );

I'll close this one for now. Thanks for updating with the resolution!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants