Skip to content

Instance Method

unverified(_:as:parser:)

Decodes an unverified JWT payload.
func unverified<Payload>(_ token: String, as _: Payload.Type = Payload.self, parser: (any JWTParser)? = nil) throws -> Payload where Payload : JWTPayload

Parameters

token

A JWT token string.

Return Value

The decoded payload of the specified type.

Discussion

This method does not verify the signature of the JWT and should be used with caution.

Throws

An error if the payload cannot be decoded.