Pow v1.0.13 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.keys/1.

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.

List all user session keys stored for a certain user struct.

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 session 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.

Callback implementation for Pow.Store.Base.keys/1.

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.

Link to this function

user_session_keys(config, backend_config, struct) View Source
user_session_keys(Pow.Config.t(), Pow.Config.t(), module()) :: [any()]

List all user session keys stored for a certain user struct.

Each user session key can be used to look up all sessions for that user.