auth_plug v0.8.0 AuthPlug
Link to this section Summary
Functions
call/2
is invoked to handle each HTTP request which auth_plug
protects.
If the conn
contains a valid JWT in Authentication Headers,
jwt query parameter or Phoenix Session, then continue to the protected route,
else redirect to the auth_url
with the referer set as the continuation URL.
session_options/0
returns the list of Phoenix/Plug Session options.
This is useful if you need to check them or use them somewhere else.
setup_session/1
configures the Phoenix/Plug Session.
Link to this section Functions
call(conn, options)
call/2
is invoked to handle each HTTP request which auth_plug
protects.
If the conn
contains a valid JWT in Authentication Headers,
jwt query parameter or Phoenix Session, then continue to the protected route,
else redirect to the auth_url
with the referer set as the continuation URL.
init(options)
init/1
initialises the options passed in and makes them
available in the lifecycle of the call/2
invocation (below).
We pass in the auth_url
key/value with the URL of the Auth service
to redirect to if session is invalid/expired.
session_options()
session_options/0
returns the list of Phoenix/Plug Session options.
This is useful if you need to check them or use them somewhere else.
setup_session(conn)
setup_session/1
configures the Phoenix/Plug Session.