Slovo::Controller::Auth - и миръ Его не позна.
Slovo::Controller::Auth implements actions for authenticating users. It depends on functionality, provided by Mojolicious::Plugin::Authentication. All the routes' paths mentioned below are easily modifiable because they are described in lib/Slovo/resources/etc/routes.conf thanks to Mojolicious::Plugin::RoutesConfig.
lib/Slovo/resources/etc/routes.conf
Mojolicious::Plugin::Authentication implements the following actions.
Route: {get => '/входъ', to => 'auth#form', name => 'authform'}.
{get => '/входъ', to => 'auth#form', name => 'authform'}
Renders a login form. The password is never transmitted in plain text. A digest is prepared in the browser using JavaScript (see lib/Slovo/resources/templates/auth/form.html.ep). The digest is sent and compared on the server side. The digest is different in every POST request.
lib/Slovo/resources/templates/auth/form.html.ep
This is a call back when user tries to acces a page i<under> c</управление>. If user is authenticated returns true. If not, redirects to "form".
Route: {post => '/входъ', to => 'auth#sign_in', name => 'sign_in'}.
{post => '/входъ', to => 'auth#sign_in', name => 'sign_in'}
Finds and logs in a user locally. On success redirects the user to the page from which it was redirected to the login page. On failure redirects again to the login page.
Slovo::Controller::Auth inherits all methods from Slovo::Controller and implements the following new ones.
Checks if a user is authenticated. If yes, returns true. If not, redirects to /входъ and returns false.
/входъ
Slovo::Controller::Auth implements the following functions executed by Mojolicious::Plugin::Authentication.
Mojolicious::Plugin::Authentication
To install Slovo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Slovo
CPAN shell
perl -MCPAN -e shell install Slovo
For more information on module installation, please visit the detailed CPAN module installation guide.