Wraps another action, allowing only authenticated HTTP requests.
Wraps another action, allowing only authenticated HTTP requests.
The user name is retrieved from the session cookie, and added to the HTTP request’s
username
attribute.
For example:
Authenticated { Action { request => Ok(request.username.map("Hello " + _)) } }
the type of the request body
the action to wrap
Wraps another action, allowing only authenticated HTTP requests.
Wraps another action, allowing only authenticated HTTP requests.
The user name is retrieved from the session cookie, and added to the HTTP request’s
username
attribute.
For example:
Authenticated { Action { request => Ok(request.username.map("Hello " + _)) } }
the type of the request body
function used to retrieve the user name from the request header - the default is to read from session cookie
function used to generate alternative result if the user is not authenticated - the default is a simple 401 page
the action to wrap
Key of the username attribute stored in session.
Helpers to create secure actions.