HubIdentityElixir.Authentication (HubIdentityElixir v0.1.5) View Source
The Authentication plug for use with restricted routes. Would like to attribute much of this code to the phx_gen_auth package. https://github.com/aaronrenner/phx_gen_auth Thank you.
Link to this section Summary
Functions
Helper method to store the current_user in conn.assigns for easy use in views etc.
Helper method to log in a user. This will store a user into the assign, as well as session under :current_user. Will redirect to "/"
Logs the user out.
Used for routes that require the user to be authenticated.
Link to this section Functions
Helper method to store the current_user in conn.assigns for easy use in views etc.
Helper method to log in a user. This will store a user into the assign, as well as session under :current_user. Will redirect to "/"
Logs the user out.
It clears all session data for safety. See renew_session.
Used for routes that require the user to be authenticated.
If you want to enforce the user email is confirmed before they use the application at all, here would be a good place.