CPub.Web.Authentication.Session (CPub v0.3.0) View Source

A CPub.Web.Authentication.Session is used for handling authentication with CPub.

An authenticated CPub.User has a session stored in the Plug.Session storage.

A session does not grant access to any resources. Access is granted with a CPub.Web.Authorization.

Link to this section Summary

Functions

Create a new session for a user.

Delete a session.

Get a session by id.

Link to this section Types

Specs

t() :: %CPub.Web.Authentication.Session{
  __meta__: term(),
  id: String.t(),
  last_activity: DateTime.t(),
  user: String.t()
}

Link to this section Functions

Specs

create(CPub.User.t()) :: {:ok, t()} | {:error, any()}

Create a new session for a user.

Specs

delete(String.t()) :: {:ok, t()} | {:error, any()}

Delete a session.

Specs

get_by_id(String.t()) :: {:ok, t()} | {:error, any()}

Get a session by id.