View Source PowPersistentSession.Plug.Base behaviour (Pow v1.0.39)

Base module for setting up persistent session plugs.

Any writes to backend store or client should occur in :before_send callback as defined in Plug.Conn. To ensure that the callbacks are called in the order they were set, a register_before_send/2 function is used to set callbacks instead of Plug.Conn.register_before_send/2.

See PowPersistentSession.Plug.Cookie for an implementation example.

Configuration options

  • :persistent_session_store - the persistent session store. This value defaults to {PowPersistentSession.Store.PersistentSessionCache, backend: Pow.Store.Backend.EtsCache}. The Pow.Store.Backend.EtsCache backend store can be changed with the :cache_store_backend option.

  • :cache_store_backend - the backend cache store. This value defaults to Pow.Store.Backend.EtsCache.

  • :persistent_session_ttl - integer value in milliseconds for TTL of persistent session in the backend store. This defaults to 30 days in miliseconds.

Summary

Callbacks

authenticate(t, t)

@callback authenticate(Plug.Conn.t(), Pow.Config.t()) :: Plug.Conn.t()

call(t, t)

@callback call(Plug.Conn.t(), Pow.Config.t()) :: Plug.Conn.t()

create(t, map, t)

@callback create(Plug.Conn.t(), map(), Pow.Config.t()) :: Plug.Conn.t()

init(t)

@callback init(Pow.Config.t()) :: Pow.Config.t()

Functions

store(config)

@spec store(Pow.Config.t()) :: {module(), Pow.Config.t()}