Skip to content

Commit

Permalink
Merge pull request #11 from Hexaville/noppoMan-patch-2
Browse files Browse the repository at this point in the history
Consider query parameters for callback URL
  • Loading branch information
noppoMan committed Sep 1, 2017
2 parents be6f112 + a1751c9 commit d7cc1d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/HexavilleAuth/OAuth/OAuth2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ public class OAuth2 {
}
let urlString = self.accessTokenURL!
let url = URL(string: urlString)!
let redirectURL = callbackURL.absoluteURL(withQueryItems: request.queryItems)!.absoluteString

let body: [String] = [
"client_id=\(self.consumerKey)",
"client_secret=\(self.consumerSecret)",
"code=\(code)",
"grant_type=authorization_code",
"redirect_uri=\(self.callbackURL.absoluteURL()!.absoluteString)"
"redirect_uri=\(redirectURL)"
]

let request = Request(
Expand Down Expand Up @@ -97,4 +98,3 @@ public class OAuth2 {
}

}

0 comments on commit d7cc1d1

Please sign in to comment.