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

Added checkbox CustomInput for additionalSignUpFields #860

Merged
merged 2 commits into from
Feb 22, 2017
Merged

Added checkbox CustomInput for additionalSignUpFields #860

merged 2 commits into from
Feb 22, 2017

Conversation

dariobanfi
Copy link
Contributor

Currently additionalSignUpFields parameter lets you use only the type "input" and "select".

In this PR I introduce the CheckBox custom input, which is often very useful in the registration process to accept subscription to the newsletter.

I kept the UI and font similar to the acceptTerms checkbox, but removed the gray background, see here:
screen shot 2017-02-07 at 11 35 30

additionalSignUpFields: [{
type: "checkbox",
name: "newsletter",
prefill: "true",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason for this being a string instead of a boolean value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the modifications as small as possible.
The prefill value is needed otherwise the checkbox will be "invalid" in the store and the registration won't go through.
Prefill must be string: https://github.com/auth0/lock/blob/master/src/connection/database/index.js#L107
I could change that, but it would need a lot of other changes elsewhere in the code

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

Successfully merging this pull request may close these issues.

3 participants