Guardian.Serializer behaviour

Guardian Serializer Behaviour.

Guardian requires a serializer. This serializer is responsible for fetching the resource from the encoded value in the JWT and also encoding a resource into a String so that it may be stored in the JWT

Callbacks

for_token/1

Specs:

Serializes the object into the token. Suggestion: “User:2”

from_token/1

Specs:

De-serializes the object from a token