AuthPlug (auth_plug v1.3.3)
AuthPlug
handles all our auth needs in just a handful of lines of code.
Please see README.md
for setup instructions.
Link to this section Summary
Link to this section Functions
Link to this function
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.
Link to this function
create_jwt_session(conn, claims)
Link to this function
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.