NAME
App::MFILE::WWW::Dispatch - app dispatch stub
SYNOPSIS
TBD
DESCRIPTION
This is where we override the default version of the is_authorized method defined by Web::Machine::Resource.
This module is only used in standalone mode. In derived distribution mode, the application's dispatch module will be used, instead.
METHODS
process_post
In the standalone demo-application mode, POST requests are used to handle login/logout requests generated by login-dialog.js.
Login requests look like this:
{ method: "LOGIN", path: "login", body: { nam: "foo", pwd: "bar" } }
and logout requests like this:
{ method: "LOGIN", path: "logout" }
In derived-distro mode, POST requests are also used to implement AJAX calls. See the process_post
function in App::Dochazka::WWW::Dispatch
for a real implementation.
validate_user_credentials
Called from process_post
to process login requests (special AJAX requests) originating from the JavaScript side (i.e. the login screen in login-dialog.js, via login.js).
Returns a status object - OK means the login was successful; all other statuses mean unsuccessful.
_logout
Called from process_post
to process logout requests (special AJAX requests) originating from the JavaScript side.