-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fixed Signup Bugs #455
Fixed Signup Bugs #455
Conversation
Changes: - Perform validation for custom fields on sign-up - Fix "next" button on custom fields - Remove forced "done" button on password field - Clear password value and custom field values after successful sign-up to prevent re-use of personal information for subsequent sign-ups by other users - Show the correct selected segmented UI when showing the login form after signing-up
Changes: - Provide a location for the UIAlertController popup when clicking on the terms of service and privacy policy section of the sign-up form
Added reset to User Protocol
Lock/DatabaseInteractor.swift
Outdated
@@ -112,6 +112,10 @@ struct DatabaseInteractor: DatabaseAuthenticatable, DatabaseUserCreator, Loggabl | |||
|
|||
guard !connection.requiresUsername || self.validUsername else { return callback(.nonValidInput, nil) } | |||
|
|||
for (fieldName, _) in customFields { | |||
guard self.user.validAdditionaAttribute(fieldName) else { return callback(.nonValidInput, nil) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo additiona
instead of additional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you copy/paste another PR 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this is a feature https://github.com/auth0/Lock.swift/blob/master/Lock/User.swift#L36 so it's consistently incorrect 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're saying you can't change it now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure it's not Public API, I can change it, was joking
Lock/User.swift
Outdated
@@ -35,6 +35,8 @@ protocol DatabaseUser { | |||
|
|||
func validAdditionaAttribute(_ name: String) -> Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same typo in these 2 lines
Lock/DatabaseOnlyView.swift
Outdated
form.emailField.nextField = showUsername ? form.usernameField : form.passwordField | ||
form.usernameField?.text = username | ||
form.usernameField?.returnKey = .next | ||
form.usernameField?.nextField = form.passwordField | ||
form.passwordField.returnKey = .done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this behavior gone? Pressing "return" should move to the next field, and if I'm on the last field it should submit the form.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's already handled in the SignUpView https://github.com/auth0/Lock.swift/pull/455/files#diff-f649b4489a4fed539b0916ce86019cb3R126
Tidy up of #448