-
Notifications
You must be signed in to change notification settings - Fork 219
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
Add hook for web view closing #754
Add hook for web view closing #754
Conversation
Hi @xavierLowmiller, thanks for raising this and apologies for the delay. I'll need to take a look at this in more detail, I expect to get back to this next week as I'm a bit busy at the moment. Thanks for your patience. |
Thank you! |
Auth0/WebAuth.swift
Outdated
/// | ||
/// - Parameter onWebViewClose: A closure to be executed | ||
/// - Returns: The same `WebAuth` instance to allow method chaining. | ||
func onWebViewClose(_ onWebViewClose: (() -> Void)?) -> Self |
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.
Let's call it onClose
, and the parameter callback
.
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.
Done in ce72102 👍
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.
Hi @xavierLowmiller, thanks for your patience and contribution.
I see the use case, and agree this would be a good addition. I've left a couple of comments about the naming. Please don't forget to add the respective unit tests.
02c61ed
to
c22a360
Compare
Co-authored-by: Rita Zerrizuela <zeta@widcket.com>
c22a360
to
a5596d8
Compare
…o-web-session-live-cycle
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.
LGTM, thanks @xavierLowmiller!
(Draft PR to discuss the general approach. If you're in favor of this change, I can add tests.)
📋 Changes
We're looking for a possibility to hook into the provider life cycle, in our case to show a loading animation after the web view is dismissed:
This PR adds an optional closure to be executed when the web view finishes:
🎯 Testing
Auth0.webAuth(...)
onWebViewClose
on itThe
onWebViewClose
is called when theprovider
finishes its work but before the auth transaction.