Problem
authorizeEmbedded starts ASWebAuthenticationSession but ignores the returned Bool. On iOS, authenticationSessionEmbedded(...) returns false when the redirect URL cannot be parsed or when ASWebAuthenticationSession.start() fails. On macOS, startAuthenticationSession(...) also returns the start result. In both cases, the caller can continue waiting for an authorization callback that will never arrive.
Affected files
Sources/iOS/OAuth2Authorizer+iOS.swift
Sources/macOS/OAuth2Authorizer+macOS.swift
Why fix
This can leave try await oauth.authorize() suspended indefinitely. It also makes configuration errors hard to diagnose because the public async API does not throw even though authorization did not start.
Recommended fix
Make the start result part of the throwing control flow. If the redirect URL is invalid or the session does not start, throw a specific OAuth2Error and ensure didFail(with:) resumes any pending continuation. Keep iOS and macOS behavior consistent.
Suggested tests
- Embedded authorization throws when redirect URL is invalid.
- Embedded authorization throws or fails callbacks when the authentication session does not start.
authorize() never remains pending after a failed session start.
Source: Docs/REVIEW_FINDINGS.md, Task 1.
Problem
authorizeEmbeddedstartsASWebAuthenticationSessionbut ignores the returnedBool. On iOS,authenticationSessionEmbedded(...)returnsfalsewhen the redirect URL cannot be parsed or whenASWebAuthenticationSession.start()fails. On macOS,startAuthenticationSession(...)also returns the start result. In both cases, the caller can continue waiting for an authorization callback that will never arrive.Affected files
Sources/iOS/OAuth2Authorizer+iOS.swiftSources/macOS/OAuth2Authorizer+macOS.swiftWhy fix
This can leave
try await oauth.authorize()suspended indefinitely. It also makes configuration errors hard to diagnose because the public async API does not throw even though authorization did not start.Recommended fix
Make the start result part of the throwing control flow. If the redirect URL is invalid or the session does not start, throw a specific
OAuth2Errorand ensuredidFail(with:)resumes any pending continuation. Keep iOS and macOS behavior consistent.Suggested tests
authorize()never remains pending after a failed session start.Source:
Docs/REVIEW_FINDINGS.md, Task 1.