[GH-ISSUE #265] Authorize with callback url never succeeds / fails #156

Closed
opened 2026-03-03 16:46:11 +03:00 by kerem · 3 comments
Owner

Originally created by @iby on GitHub (Aug 15, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/265

After updating to 0.6.0 something stopped working on mac. I use custom web view controller for Dropbox and GoogleDrive only, none succeed nor fail at the moment. I narrowed it down to OAuthSwift.handleOpenURL(url) call, which doesn't seem to be doing anything any longer.

public func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) {
    if let url: NSURL = navigationAction.request.URL?.URLByDeletingLastPathComponent where url.path == "/integration/oauth" {
        decisionHandler(WKNavigationActionPolicy.Cancel)
        OAuthSwift.handleOpenURL(url)
    } else {
        decisionHandler(WKNavigationActionPolicy.Allow)
    }
}

Delegate recognises url correctly. I also receive notification emails from Dropbox / Google, so it actually works.

Did anything happen to the way how handleOpenURL works? Is something new must be taken into account now?

Originally created by @iby on GitHub (Aug 15, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/265 After updating to 0.6.0 something stopped working on mac. I use custom web view controller for Dropbox and GoogleDrive only, none succeed nor fail at the moment. I narrowed it down to `OAuthSwift.handleOpenURL(url)` call, which doesn't seem to be doing anything any longer. ``` swift public func webView(webView: WKWebView, decidePolicyForNavigationAction navigationAction: WKNavigationAction, decisionHandler: (WKNavigationActionPolicy) -> Void) { if let url: NSURL = navigationAction.request.URL?.URLByDeletingLastPathComponent where url.path == "/integration/oauth" { decisionHandler(WKNavigationActionPolicy.Cancel) OAuthSwift.handleOpenURL(url) } else { decisionHandler(WKNavigationActionPolicy.Allow) } } ``` Delegate recognises url correctly. I also receive notification emails from Dropbox / Google, so it actually works. Did anything happen to the way how `handleOpenURL` works? Is something new must be taken into account now?
kerem closed this issue 2026-03-03 16:46:12 +03:00
Author
Owner

@phimage commented on GitHub (Aug 15, 2016):

I try demo app on OS X with dropbox, and no problem for me

maybe call OAuthSwift.handleOpenURL(url) before decisionHandler

Did you retain your OAuthSwift object somewhere

<!-- gh-comment-id:239810610 --> @phimage commented on GitHub (Aug 15, 2016): I try demo app on OS X with dropbox, and no problem for me maybe call `OAuthSwift.handleOpenURL(url)` before `decisionHandler` Did you retain your OAuthSwift object somewhere
Author
Owner

@iby commented on GitHub (Aug 15, 2016):

Tried it both ways, no luck. I'll take a closer look then.

On 15 Aug 2016, at 18:07, Eric Marchand notifications@github.com wrote:

I try demo app on OS X with dropbox, and no problem for me

maybe call OAuthSwift.handleOpenURL(url) before decisionHandler


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

<!-- gh-comment-id:239824959 --> @iby commented on GitHub (Aug 15, 2016): Tried it both ways, no luck. I'll take a closer look then. > On 15 Aug 2016, at 18:07, Eric Marchand notifications@github.com wrote: > > I try demo app on OS X with dropbox, and no problem for me > > maybe call OAuthSwift.handleOpenURL(url) before decisionHandler > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub, or mute the thread.
Author
Owner

@iby commented on GitHub (Aug 16, 2016):

Did you retain your OAuthSwift object somewhere?

Shit… Would have saved me a lot of time if came with the email.

Yes, I see some changes around that – OAuthSwift was retained internally, I guess not intentionally, since that all changed, but that also automatically retained it for me. Thanks for pointing out.

<!-- gh-comment-id:240061132 --> @iby commented on GitHub (Aug 16, 2016): > Did you retain your OAuthSwift object somewhere? Shit… Would have saved me a lot of time if came with the email. Yes, I see some changes around that – `OAuthSwift` was retained internally, I guess not intentionally, since that all changed, but that also automatically retained it for me. Thanks for pointing out.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#156
No description provided.