Catalyst::ActionRole::NeedsLogin - checks if a user is logged in and if not redirects him to login page
package MyApp::Controller::NeedsAuth; sub something : Path Does('NeedsLogin') { # Redirects to /login if not logged in } sub something : Path Does('NeedsLogin') :LoginRedirectMessage('Your custom Message') { # Redirects to /login if not logged in- } # Turn on in config MyApp->config('Contoller::Login' => { traits => ['WithRedirect'] });
Provides a ActionRole for forcing the user to login.
FIXME
See CatalystX::SimpleLogin for authors.
See CatalystX::SimpleLogin for license.
To install CatalystX::SimpleLogin, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CatalystX::SimpleLogin
CPAN shell
perl -MCPAN -e shell install CatalystX::SimpleLogin
For more information on module installation, please visit the detailed CPAN module installation guide.