Pow v1.0.0-rc.0 Pow.Store.CredentialsCache View Source

Default module for credentials session storage.

A key (session id), is used to store, fetch or delete credentials. When credentials are stored or deleted, a credentials key will be generated. The value of that key will be all current keys (session ids), and the most recent credentials.

When a key is updated, all expired keys will be pruned from the credentials key.

Link to this section Summary

Functions

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

Delete the sesison id from the backend store

Callback implementation for Pow.Store.Base.get/2

Fetch user credentials from the backend store from session id

Callback implementation for Pow.Store.Base.put/3

Add user credentials with the session id to the backend store

List all existing sessions for the user fetched from the backend store

Link to this section Functions

Link to this function delete(config, key) View Source
delete(Pow.Config.t(), binary()) :: :ok

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

Link to this function delete(config, backend_config, session_id) View Source
delete(Pow.Config.t(), Pow.Config.t(), binary()) :: :ok

Delete the sesison id from the backend store.

This will delete the sesison id from the session list for the user credentials in the backend store. If the session id is the only one in the session list, the user credentials will be deleted too from the backend store.

Link to this function get(config, key) View Source
get(Pow.Config.t(), binary()) :: any() | :not_found

Callback implementation for Pow.Store.Base.get/2.

Link to this function get(config, backend_config, session_id) View Source
get(Pow.Config.t(), Pow.Config.t(), binary()) :: any() | :not_found

Fetch user credentials from the backend store from session id.

Link to this function put(config, key, value) View Source
put(Pow.Config.t(), binary(), any()) :: :ok

Callback implementation for Pow.Store.Base.put/3.

Link to this function put(config, backend_config, session_id, user) View Source
put(Pow.Config.t(), Pow.Config.t(), binary(), any()) :: :ok

Add user credentials with the session id to the backend store.

This will either create or update the current user credentials in the backend store. The session id will be appended to the session list for the user credentials.

Link to this function sessions(config, backend_config, user) View Source
sessions(Pow.Config.t(), Pow.Config.t(), map()) :: [binary()]

List all existing sessions for the user fetched from the backend store.