curator v0.1.0 Curator.PlugHelper

A helper for Plugs to interact with Curator. This will act as an adapter between the curator modules and the configured session_handler.

Summary

Functions

Clears the authenticated resource. This will also set an error and delete the session

Fetch the currently authenticated resource if loaded, optionally located at a location (key)

set the authenticated resource, optionally located at a location (key)

Sign in a resource (that your configured serializer knows about) into the current web session

Sign out of a session

Functions

clear_current_resource_with_error(conn, error, the_key \\ :default)
clear_current_resource_with_error(Plug.Conn.t, any, atom) :: Plug.Conn.t

Clears the authenticated resource. This will also set an error and delete the session.

current_resource(conn, the_key \\ :default)
current_resource(Plug.Conn.t, atom) :: any | nil

Fetch the currently authenticated resource if loaded, optionally located at a location (key)

set_current_resource(conn, resource, the_key \\ :default)
set_current_resource(Plug.Conn.t, any, atom) :: Plug.Conn.t

set the authenticated resource, optionally located at a location (key)

sign_in(conn, object)
sign_in(Plug.Conn.t, any) :: Plug.Conn.t

Sign in a resource (that your configured serializer knows about) into the current web session.

sign_out(conn, the_key \\ :all)

Sign out of a session.

If no key is specified, the entire session is cleared. Otherwise, only the location specified is cleared