Opaque session token generation and hashing.
Raw tokens are sent to clients (cookie). Only SHA-256 hashes are stored in the
database, following the phx_gen_auth model.
Summary
Functions
Generates a URL-safe opaque session token.
Hashes a raw token for database storage.
Returns the TTL in seconds for a token context.
Constant-time comparison of a raw token against a stored hash.
Functions
@spec generate() :: binary()
Generates a URL-safe opaque session token.
Hashes a raw token for database storage.
@spec ttl(atom()) :: non_neg_integer()
Returns the TTL in seconds for a token context.
Constant-time comparison of a raw token against a stored hash.