Phauxth v0.13.0-rc.0 Phauxth.Remember View Source
Remember me Plug using Phoenix Token.
Options
There are three options:
token - the token key source to use when using Phoenix token
in most cases, this will be the name of the endpoint you are using
- can also be
Plug.Conn
,Phoenix.Socket
or a string representing the secret key base
- can also be
- see the documentation for Phoenix.Token for more information
max_age - the length of the validity of the token
- the default is four weeks
user_context - the user context module to be used
- the default is MyApp.Accounts
Examples
Add the following line to the pipeline you want to authenticate in
the web/router.ex
file:
plug Phauxth.Authenticate
plug Phauxth.Remember
Make sure you add the Phauxth.Remember Plug after Phauxth.Authenticate.
Link to this section Summary
Functions
Add a Phoenix token as a remember me cookie
Delete the remember_me cookie
Set the current_user
variable
Link to this section Functions
Add a Phoenix token as a remember me cookie.
Delete the remember_me cookie.
Set the current_user
variable.