Skip to content

Commit

Permalink
Login.authorize changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowfacts committed Aug 20, 2018
1 parent 6a03c64 commit 30aa01a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/MastodonKit/Models/LoginSettings.swift
Expand Up @@ -14,7 +14,7 @@ public class LoginSettings: Codable {
/// Access token type.
public let accessTokenType: String
/// The refresh token.
public let refreshToken: String
public let refreshToken: String?
/// Date when the access token was retrieved.
// public let createdAt: TimeInterval
/// Access scope.
Expand Down
3 changes: 2 additions & 1 deletion Sources/MastodonKit/Requests/Login.swift
Expand Up @@ -32,10 +32,11 @@ public struct Login {
return Request<LoginSettings>(path: "/oauth/token", method: method)
}

public static func authorize(code: String, clientID: String, clientSecret: String) -> Request<LoginSettings> {
public static func authorize(code: String, clientID: String, clientSecret: String, redirectURI: String) -> Request<LoginSettings> {
let parameters = [
Parameter(name: "client_id", value: clientID),
Parameter(name: "client_secret", value: clientSecret),
Parameter(name: "redirect_uri", value: redirectURI),
Parameter(name: "grant_type", value: "authorization_code"),
Parameter(name: "code", value: code)
]
Expand Down

0 comments on commit 30aa01a

Please sign in to comment.