diff --git a/OAuthSwift/OAuth1Swift.swift b/OAuthSwift/OAuth1Swift.swift index bad45fcc..c30b4062 100644 --- a/OAuthSwift/OAuth1Swift.swift +++ b/OAuthSwift/OAuth1Swift.swift @@ -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) diff --git a/OAuthSwiftOSXDemo/AppDelegate.swift b/OAuthSwiftOSXDemo/AppDelegate.swift index d8b89cbe..6e8692cc 100644 --- a/OAuthSwiftOSXDemo/AppDelegate.swift +++ b/OAuthSwiftOSXDemo/AppDelegate.swift @@ -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") {