authex v0.2.0 Authex.Serializer behaviour View Source

Link to this section Summary

Functions

Takes a resource and turns it into an Authex.Token using the provided serializer

Takes an Authex.Token struct and runs the provided serializer against it

Link to this section Types

Link to this type serializer() View Source
serializer() :: atom()

Link to this section Functions

Link to this function for_token(serializer, resource) View Source
for_token(serializer(), term()) :: Authex.Token.t()

Takes a resource and turns it into an Authex.Token using the provided serializer.

Parameters

  • serializer: A serializer module.
  • resource: Any data structure the serializer can use.
Link to this function from_token(serializer, token) View Source
from_token(serializer(), Authex.Token.t()) :: term()

Takes an Authex.Token struct and runs the provided serializer against it.

Parameters

  • serializer: A serializer module.
  • token: An Authex.Token struct.

Link to this section Callbacks

Link to this callback handle_for_token(term) View Source
handle_for_token(term()) :: Authex.Token.t() | :error
Link to this callback handle_from_token(arg0) View Source
handle_from_token(Authex.Token.t()) :: term() | :error