Pow v0.1.0-alpha.1 Pow.Plug.Session View Source

This plug will handle user authorization using session.

Example

plug Plug.Session,
  store: :cookie,
  key: "_my_app_demo_key",
  signing_salt: "secret"

plug Pow.Plug.Session,
  repo: MyApp.Repo,
  user: MyApp.User,
  current_user_assigns_key: :current_user,
  session_key: "auth",
  session_store: {Pow.Store.CredentialsCache,
                  ttl: :timer.minutes(30),
                  namespace: "credentials"},
  session_ttl_renewal: :timer.minutes(15),
  cache_store_backend: Pow.Store.Backend.EtsCache,
  users_context: Pow.Ecto.Users

Configuration options

  • :session_key session key name
  • :session_store credentials cache store to use
  • :cache_store_backend backend key value store to use
  • :session_ttl_renewal the ttl until trigger renewal of session

Link to this section Summary

Link to this section Functions

Callback implementation for Pow.Plug.Base.call/2.

Link to this function create(conn, user, config) View Source
create(Plug.Conn.t(), map(), Pow.Config.t()) :: {Plug.Conn.t(), map()}

Callback implementation for Pow.Plug.Base.create/3.

Callback implementation for Pow.Plug.Base.delete/2.

Link to this function do_create(conn, user) View Source
do_create(Plug.Conn.t(), map()) :: Plug.Conn.t()
Link to this function fetch(conn, config) View Source
fetch(Plug.Conn.t(), Pow.Config.t()) :: {Plug.Conn.t(), map() | nil}

Callback implementation for Pow.Plug.Base.fetch/2.

Callback implementation for Pow.Plug.Base.init/1.