getPayload

inline fun <T> getPayload(jsonInstance: Json = Jwt.defaultJsonParser): T(source)

Deserializes the token payload as type T.

Return

the payload deserialized into an instance of T

Parameters

T

the target type to deserialize the payload into

jsonInstance

the Json instance to use for deserialization; defaults to the library's Jwt.defaultJsonParser configuration (ignoreUnknownKeys = true, explicitNulls = false)


fun <T> getPayload(serializer: KSerializer<T>, jsonInstance: Json = Jwt.defaultJsonParser): T(source)

Deserializes the token payload using the given serializer.

Return

the payload deserialized into an instance of T

Parameters

T

the target type to deserialize the payload into

serializer

the KSerializer used to deserialize the payload

jsonInstance

the Json instance to use for deserialization; defaults to the library's Jwt.defaultJsonParser configuration (ignoreUnknownKeys = true, explicitNulls = false)