Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created September 2, 2018 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/4c7bc5cdc01bd1a342b81f81641e0b74 to your computer and use it in GitHub Desktop.
Save fitomad/4c7bc5cdc01bd1a342b81f81641e0b74 to your computer and use it in GitHub Desktop.
public func authorizationURL() -> URL?
{
var components = URLComponents(string:"https://api.trakt.tv/oauth/authorize")
let queryItems:[URLQueryItem]=[
URLQueryItem(name: "response_type", value: "code"),
URLQueryItem(name: "client_id", value: self.clientID),
URLQueryItem(name: "redirect_uri", value: self.redirecURL.absoluteString),
URLQueryItem(name: "state", value: " ")
]
components?.queryItems = queryItems
return components?.url
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment