Coherence.DbStore protocol (Coherence v0.8.0)

Database persistence of current_user data.

Implement this protocol to add database storage, allowing session data to survive application restarts.

Summary

Functions

Delete current user credentials.

Delete all logged in users.

Get authenticated user data.

Save authenticated user data in the database.

Types

@type schema() :: Ecto.Schema.t() | map() | nil
@type t() :: term()

Functions

Link to this function

delete_credentials(resource, credentials)

@spec delete_credentials(schema(), String.t()) :: :ok

Delete current user credentials.

Link to this function

delete_user_logins(resource)

@spec delete_user_logins(schema()) :: :ok

Delete all logged in users.

Link to this function

get_user_data(resource, credentials, id_key)

@spec get_user_data(schema(), String.t(), atom()) :: schema()

Get authenticated user data.

Link to this function

put_credentials(resource, credentials, id_key)

@spec put_credentials(schema(), String.t(), atom()) :: :ok

Save authenticated user data in the database.