AuthN v0.3.0 AuthN.Plugs.AssignCurrentUser View Source
This plug fetches the current user by the user ID stored in session and stores
the fetched user in conn.assigns
.
The user is fetched by a function provided through the mandatory :fetch_user
option; the function receives the user ID as argument.
In case no user ID is stored in session, this plug does nothing (just returns
the conn
received). In case a user ID is stored in session, but no user can
be found for that ID, the plug clears the session.