Skip to content

Commit

Permalink
Consider query parameters for callback URL
Browse files Browse the repository at this point in the history
  • Loading branch information
noppoMan committed Sep 1, 2017
1 parent be6f112 commit a1751c9
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 a1751c9

Please sign in to comment.