Current section

Files

Jump to
phauxth lib phauxth token.ex
Raw

lib/phauxth/token.ex

defmodule Phauxth.Token do
@moduledoc """
Behaviour for signing and verifying tokens.
See Phauxth.PhxToken for an example implementation of this behaviour
using Phoenix tokens.
"""
@type data :: map | keyword | binary | integer
@type opts :: keyword
@doc """
Signs a token.
"""
@callback sign(data, opts) :: binary
@doc """
Verifies a token.
"""
@callback verify(binary, opts) :: {:ok, map} | {:error, atom | binary}
end