AuthN v0.10.0 AuthN.Plugs.AssignCurrentUser View Source

This plug fetches the current user by the user token stored in session and stores the user in conn.assigns.

The user is fetched by a function provided through the mandatory :get_user_by_session_token_fun option; the function receives the user ID as argument.

In case no user token is stored in session, this plug does nothing (just returns the conn received). In case a user token is stored in session, but no user can be found for that token, the plug clears the session.

Link to this section Summary

Link to this section Functions