Skip to content

Commit

Permalink
Changes from latest Vapor OAuth release
Browse files Browse the repository at this point in the history
  • Loading branch information
0xTim committed Aug 5, 2017
1 parent 0a9d407 commit 1440063
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Sources/OAuthFluent/Managers/FluentUserManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public struct FluentUserManager: UserManager {
return user?.id
}

public func getUser(id: Identifier) -> OAuthUser? {
return (try? OAuthUser.find(id)) ?? nil
public func getUser(userID: Identifier) -> OAuthUser? {
return (try? OAuthUser.find(userID)) ?? nil
}
}
15 changes: 8 additions & 7 deletions Tests/OAuthFluentTests/OAuthFluentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class OAuthFluentTests: XCTestCase {
}

class CapturingAuthHandler: AuthorizeHandler {

func handleAuthorizationError(_ errorType: AuthorizationError) throws -> ResponseRepresentable {
return "ERROR"
}
Expand All @@ -291,14 +292,14 @@ class CapturingAuthHandler: AuthorizeHandler {
private(set) var scope: [String]?
private(set) var state: String?
private(set) var csrfToken: String?
func handleAuthorizationRequest(_ request: Request, responseType: String, clientID: String, redirectURI: URI, scope: [String], state: String?, csrfToken: String) throws -> ResponseRepresentable {
func handleAuthorizationRequest(_ request: Request, authorizationRequestObject: AuthorizationRequestObject) throws -> ResponseRepresentable {
self.request = request
self.responseType = responseType
self.clientID = clientID
self.redirectURI = redirectURI
self.scope = scope
self.state = state
self.csrfToken = csrfToken
self.responseType = authorizationRequestObject.responseType
self.clientID = authorizationRequestObject.clientID
self.redirectURI = authorizationRequestObject.redirectURI
self.scope = authorizationRequestObject.scope
self.state = authorizationRequestObject.state
self.csrfToken = authorizationRequestObject.csrfToken
return "ALLOW"
}
}
Expand Down

0 comments on commit 1440063

Please sign in to comment.