-
Notifications
You must be signed in to change notification settings - Fork 243
SDK-5963 Swift 6 support #961
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
base: master
Are you sure you want to change the base?
Conversation
@@ -51,15 +51,15 @@ public struct WebAuthentication { | |||
/// - Parameter url: The URL sent by the external user agent that contains the result of the web-based operation. | |||
/// - Returns: If the URL was expected and properly formatted. | |||
@discardableResult | |||
public static func resume(with url: URL) -> Bool { | |||
return TransactionStore.shared.resume(url) | |||
public static func resume(with url: URL) async -> 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.
This is a breaking change, as it's making async a previously sync function.
} | ||
|
||
/// Terminates the ongoing web-based operation and reports back that it was cancelled. | ||
/// You need to call this method within your custom Web Auth provider implementation whenever the operation is | ||
/// cancelled by the user. | ||
public static func cancel() { | ||
TransactionStore.shared.cancel() | ||
public static func cancel() async { |
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.
This is a breaking change, as it's making async a previously sync function.
|
||
/// Tears down the external user agent after the web-based operation completed, if needed. | ||
/// Auth0.swift will call this method after the callback URL was received and processed, or after the user | ||
/// cancelled the operation, or after any other error occurred. | ||
/// | ||
/// - Parameter result: The outcome of the web-based operation, containing either an empty success case or an | ||
/// error. | ||
func finish(with result: WebAuthResult<Void>) | ||
func finish(with result: WebAuthResult<Void>) async |
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.
This is a breaking change, as it's making async a previously sync function.
|
||
/// Starts the external user agent. | ||
func start() | ||
func start() async |
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.
This is a breaking change, as it's making async a previously sync function.
|
||
/// Thunk that returns a function that creates and returns a ``WebAuthUserAgent`` to perform a web-based operation. | ||
/// The ``WebAuthUserAgent`` opens the URL in an external user agent and then invokes the callback when done. | ||
/// | ||
/// ## See Also | ||
/// | ||
/// - [Example](https://github.com/auth0/Auth0.swift/blob/master/Auth0/SafariProvider.swift) | ||
public typealias WebAuthProvider = (_ url: URL, _ callback: @escaping WebAuthProviderCallback) -> WebAuthUserAgent | ||
public typealias WebAuthProvider = (_ url: URL, _ callback: @escaping @Sendable WebAuthProviderCallback) async -> WebAuthUserAgent |
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.
This is a breaking change, as it's making async a previously sync function.
Same for all the other similar changes in this file.
return UIApplication.shared()?.windows.last(where: \.isKeyWindow) ?? ASPresentationAnchor() | ||
} | ||
#endif | ||
|
||
#if os(visionOS) | ||
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { | ||
nonisolated func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { |
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.
Should this be nonisolated
if this is UI-related code that needs to run on the main thread?
📋 Changes
📎 References
🎯 Testing