anmolitor / protobuf-web-tokens / Protobuf.Token

Decode Protobuf Web Tokens (PWT)


type alias TokenData t =
{ validUntil : Time.Posix, claims : t }

Claims encoded in the token and some metadata

decode : Protobuf.Decode.Decoder t -> String -> Result Error (TokenData t)

Decodes a Protobuf Web Token using the given decoder.


type Error
    = InvalidFormat
    | InvalidBase64
    | InvalidBytes
    | NoValidUntilField

The ways a token decoding can fail