Instance Method
verify(_:as:iteratingKeys:)
Verifies and decodes a JWT token to extract the payload.
func verify<Payload>(_ token: String, as _: Payload.Type = Payload.self, iteratingKeys: Bool = false) async throws -> Payload where Payload : JWTPayload
Parameters
tokenA JWT token string.
asThe type of payload to decode.
iteratingKeysWhether to try verifying the token with all keys in the collection.
Return Value
The verified and decoded payload of the specified type.
Discussion
Throws
An error if the token cannot be verified or decoded.