Bouncer.Plugs.Authorize
The Authorize plug can be used to scan a connection for an authorization token and use it to retrieve a user session so it can be added to the connection.
Summary
Functions
Adds the user’s session data to the connection so that the controller actions that use the plug can determine what to do with the information
Scans a connection for an authroization token, uses the token to retrieve a user, adds it to the connection, and returns the connection
Returns the value of the request authorization header
Pulls the authorization token out of the request header value
Functions
Adds the user’s session data to the connection so that the controller actions that use the plug can determine what to do with the information.
Scans a connection for an authroization token, uses the token to retrieve a user, adds it to the connection, and returns the connection.
Pulls the authorization token out of the request header value.
Examples
iex> Bouncer.Plugs.Authorize.get_authorization_token "Bearer: test"
"test"
iex> Bouncer.Plugs.Authorize.get_authorization_token nil
nil