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

Expose onForgotPassword [SDK-2632] #673

Merged
merged 3 commits into from
Jul 19, 2021
Merged

Conversation

Widcket
Copy link
Contributor

@Widcket Widcket commented Jul 2, 2021

Changes

This PR exposes in the public API the onForgotPassword callback that was implemented and had unit tests, but could not be used as there was no public API for it.

Implementation

case .forgotPassword(let email):

Unit tests

https://github.com/auth0/Lock.swift/blob/master/LockTests/Models/ObserverStoreSpec.swift#L79
https://github.com/auth0/Lock.swift/blob/master/LockTests/Models/ObserverStoreSpec.swift#L149
https://github.com/auth0/Lock.swift/blob/master/LockTests/Models/ObserverStoreSpec.swift#L154
https://github.com/auth0/Lock.swift/blob/master/LockTests/Models/ObserverStoreSpec.swift#L163

Screen.Recording.2021-07-01.at.20.51.08.mov

References

Fixes #666

Lock.Android exposes a RESET_PASSWORD event: https://github.com/auth0/Lock.Android/blob/main/lib/src/main/java/com/auth0/android/lock/LockCallback.java#L56

Testing

The callback has unit tests, but it was also tested manually using an iPhone simulator. A unit test covering the new public API method was also added.

  • This change adds unit test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@Widcket Widcket requested a review from a team as a code owner July 2, 2021 00:01
@Widcket Widcket changed the title Expose onForgotPassword Expose onForgotPassword [SDK-2632] Jul 2, 2021
Copy link
Contributor

@lbalmaceda lbalmaceda left a comment

Choose a reason for hiding this comment

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

While there's a constant defined for the event, Lock Android does not invoke the callback when the "send password reset" request was successful. See here: https://github.com/auth0/Lock.Android/blob/main/lib/src/main/java/com/auth0/android/lock/LockActivity.java#L575-L583.

I know there are disparities when we invoke the callbacks between these two platforms, so I'm not going to block this change. But bear in mind that merging this would contribute to adding more differences.

This change cannot be added in a non-breaking way to the current Lock Android major.

@Widcket
Copy link
Contributor Author

Widcket commented Jul 2, 2021

@lbalmaceda why is the event defined but not used?

@lbalmaceda
Copy link
Contributor

@Widcket Not sure why that event was never used internally in Android. Let's take a day or two to revisit the differences between both platforms in terms of callbacks and event handling and come back with an outcome we can share.

@Widcket Widcket merged commit b29d5db into master Jul 19, 2021
@Widcket Widcket deleted the feature/onForgotPassword branch July 19, 2021 16:55
@Widcket Widcket added this to the 2.23.0 milestone Jul 20, 2021
@Widcket Widcket mentioned this pull request Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Callback for onForgotPassword
2 participants