Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongri Jin committed May 12, 2015
1 parent dc9f13e commit 43a05b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OAuthSwift/OAuth1Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public class OAuth1Swift: NSObject {
}
})
// 2. Authorize
if let queryURL = NSURL(string: self.authorize_url + (self.authorize_url.has("?") ? "&" : "?") + "key=\(self.consumer_key)&oauth_callback=\(callbackURL.absoluteString!)") {
if let queryURL = NSURL(string: self.authorize_url + (self.authorize_url.has("?") ? "&" : "?") + "oauth_token=\(credential.oauth_token)") {
self.authorize_url_handler.handle(queryURL)
}
}, failure: failure)
Expand Down
5 changes: 2 additions & 3 deletions OAuthSwiftOSXDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// Insert code here to tear down your application
}

private func handleGetURLEvent(event: NSAppleEventDescriptor, withReplyEvent replyEvent: NSAppleEventDescriptor)
{
func handleGetURLEvent(event: NSAppleEventDescriptor!, withReplyEvent: NSAppleEventDescriptor!) {
if let urlString = event.paramDescriptorForKeyword(AEKeyword(keyDirectObject))?.stringValue, url = NSURL(string: urlString) {
applicationHandleOpenURL(url)
}
}

internal func applicationHandleOpenURL(url: NSURL) {
println(url)
if (url.host == "oauth-callback") {
Expand Down

0 comments on commit 43a05b2

Please sign in to comment.