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

Custom Fields #487

Closed
talamihg opened this issue Jun 19, 2018 · 8 comments
Closed

Custom Fields #487

talamihg opened this issue Jun 19, 2018 · 8 comments
Milestone

Comments

@talamihg
Copy link

talamihg commented Jun 19, 2018

It doesn't seem that the Custom Signup Fields option is working. I've included some JSON, but its not changing Lock to include those fields.

[{
name: "first_name",
placeholder: "First Name"
}]

I am assuming that you want the square brackets around the entire array like shown here: https://auth0.com/docs/libraries/lock/v11/configuration#text-fields ?

Can confirm that the JSON block above is producing this on /wp-login.php

<script type="text/javascript">document.addEventListener("DOMContentLoaded", function() { wpAuth0LockGlobal.settings.additionalSignUpFields=[{
name: "first_name",
placeholder: "First Name"
}]});</script>
@joshcanhelp
Copy link
Contributor

Hi @talamihg ... I pasted the JSON here into my local install and see the fields just fine:

screenshot 2018-06-19 15 30 35

They only appear on the Signup tab ... are you only looking on the Login tab? If not, do you see any errors in your JS console?

@singularityjay
Copy link

singularityjay commented Jun 20, 2018

Same issue here. Also the "extra settings" don't work either.

Solved:
@joshcanhelp thanks for your help on this. I found that there was a conflict with jquery ui, getting rid of it worked. As for the extra settings, I had to get rid of brackets around the curly brackets. Eg, {"mustAcceptTearms": true}

@talamihg
Copy link
Author

Humm, would be any dashboard settings on manage.auth0.com that would be overriding the settings within WordPress?

@joshcanhelp
Copy link
Contributor

@singularityjay - Can you check that those are being output in the page code? View source and search for what you've added. The extra settings field is pretty widely used and works fine on my end so it might be malformed JSON in there.

@talamihg - No, Lock generally happens in-place in terms of customization. Passwordless adjustments in the dashboard will map over but not fields. In my last reply I asked to make sure that you're on the signup tab when you're checking and there are no errors in the console. Can you confirm?

@talamihg
Copy link
Author

Sorry I didn't respond with that request. Yes, I am viewing the Sing Up tab and I am only seeing the default email and password fields. I am not seeing any JS errors but there is one JS warning.

index.js:400 There was an error fetching the SSO data. This could simply mean that there was a problem with the network. But, if a "Origin" error has been logged before this warning, please add "https://..." to the "Allowed Web Origins" list in the Auth0 dashboard: https://manage.auth0.com/#/clients/.../settings

The strange thing, the URL referred to is added to my Allowed Web Origins settings on the auth0 dashboard.

@joshcanhelp
Copy link
Contributor

@talamihg - Thanks for that. I see that warning every now and then as well. As long as logins/signups are functioning properly then nothing to worry on that.

I'm not entirely sure where to go with this one. The field JSON is just saved in the DB and output to the page where Lock picks it up. If you're on a test install, I would try the usual WP debugging - default theme and no other plugins. If you can send me a URL to where this is being output directly, I can take a look. Not a bad idea to include your settings export file again as well (minus anything sensitive).

@joshcanhelp
Copy link
Contributor

@talamihg - It looks like what's happening here is that the extra fields are not being pulled into the global options var before Lock is initialized. You can re-initialize Lock in the console using the global options once everything has loaded and the fields show up fine. It looks like the DOMContentLoaded event that I'm using is not reliable for what we're trying to do.

I'll put through a PR now and link it to here. If you're able to either pull the branch or use the diff to test, that would be very helpful!

Thank you!

@joshcanhelp
Copy link
Contributor

Fixed in #491 and merged into dev for testing.

@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

3 participants