From 30fff1d9253d5b780feb8d1da4ca1960f8e79344 Mon Sep 17 00:00:00 2001 From: Adam Fowler Date: Fri, 18 Oct 2024 08:44:49 +0100 Subject: [PATCH] Require payload to be Sendable --- Sources/SotoCognitoAuthentication/Authenticators.swift | 2 +- Sources/SotoCognitoAuthentication/Request+Cognito.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/SotoCognitoAuthentication/Authenticators.swift b/Sources/SotoCognitoAuthentication/Authenticators.swift index 5556827..401f7c5 100644 --- a/Sources/SotoCognitoAuthentication/Authenticators.swift +++ b/Sources/SotoCognitoAuthentication/Authenticators.swift @@ -70,7 +70,7 @@ public struct CognitoAccessAuthenticator: AsyncBearerAuthenticator { /// Authenticator for Cognito id tokens. Can use this to extract information from Id Token into Payload struct. The list of standard list of claims found in an id token are /// detailed in the [OpenID spec] (https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims) . Your `Payload` type needs /// to decode using these tags, plus the AWS specific "cognito:username" tag and any custom tags you have setup for the user pool. -public struct CognitoIdAuthenticator: AsyncBearerAuthenticator { +public struct CognitoIdAuthenticator: AsyncBearerAuthenticator { public init() {} public func authenticate(bearer: BearerAuthorization, for request: Request) async throws { diff --git a/Sources/SotoCognitoAuthentication/Request+Cognito.swift b/Sources/SotoCognitoAuthentication/Request+Cognito.swift index c42aaa5..5b3da75 100644 --- a/Sources/SotoCognitoAuthentication/Request+Cognito.swift +++ b/Sources/SotoCognitoAuthentication/Request+Cognito.swift @@ -42,7 +42,7 @@ public extension Request { /// helper function that returns if request with bearer token is cognito id authenticated and returns contents in the payload type /// - returns: /// The payload contained in the token. See `authenticate(idToken:on:)` for more details - public func authenticateId() async throws -> Payload { + public func authenticateId() async throws -> Payload { guard let bearer = request.headers.bearerAuthorization else { throw Abort(.unauthorized) }