catalystx::simplelogin::traitfor::controller::login::withredirec(3pm) [debian man page]
CatalystX::SimpleLogin::TraitFor::Controller::Login::WitUseriContributed PerCatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect(3pm)NAME
CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect - redirect users who login back to the page they originally requested.
SYNOPSIS
package MyApp::Controller::NeedsAuth;
use Moose;
use namespace::autoclean;
# One needs to inherit from Catalyst::Controller in order
# to get the Does('NeedsLogin') functionality.
BEGIN { extends 'Catalyst::Controller'; }
sub inbox : Path Does('NeedsLogin') {
# Redirects to /login if not logged in
my ($self, $c) = @_;
$c->stash->{template} = "inbox.tt2";
return;
}
# Turn on in config
MyApp->config('Contoller::Login' => { traits => 'WithRedirect' });
DESCRIPTION
Provides the "login" action with a wrapper to redirect to a page which needs authentication, from which the user was previously redirected.
Goes hand in hand with Catalyst::ActionRole::NeedsLogin
WRAPPED METHODS
redirect_after_login_uri
Make it use and extract "$c->session->{redirect_to_after_login}" if it exists.
METHODS
$controller->login_redirect($c, $message)
This sets the error message to $message and sets "$c->session->{redirect_to_after_login}" to the current URL.
SEE ALSO
CatalystX::SimpleLogin::Controller::Login
CatalystX::SimpleLogin::Form::Login
AUTHORS
See CatalystX::SimpleLogin for authors.
LICENSE
See CatalystX::SimpleLogin for license.
perl v5.14.22012-07-CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect(3pm)
Check Out this Related Man Page
CatalystX::SimpleLogin::Form::Login(3pm) User Contributed Perl Documentation CatalystX::SimpleLogin::Form::Login(3pm)NAME
CatalystX::SimpleLogin::Form::Login - validation for the login form
DESCRIPTION
A HTML::FormHandler form for the login form.
FIELDS
username
password
remember
submit
METHODS
validate
add_auth_errors
SEE ALSO
CatalystX::SimpleLogin::Controller::Login
CUSTOMIZATION
By default, the params passed to authenticate() are 'username' and 'password'. If you need to use different names, then you'll need to set
the correct value(s) via login_form_args in the configuration. The keys are 'authenticate_username_field_name' and/or
'authenticate_password_field_name'.
__PACKAGE__->config(
'Controller::Login' => {
login_form_args => {
authenticate_username_field_name => 'name',
authenticate_password_field_name => 'password2',
},
},
);
You can also change the way that the form is displayed by setting attributes. In MyApp.pm:
__PACKAGE__->config(
'Controller::Login' => {
login_form_args => {
login_error_message => 'Login failed',
field_list => [
'+submit' => { value => 'Login' },
]
}
},
);
Additional fields can be added:
field_list => [
'foo' => ( type => 'MyField' ),
'bar' => { type => 'Text' },
]
Additional arguments to the authenticate call can be added: If your user table has a column "status" and you want only those with "status =
'active'"to be able to log .in
__PACKAGE__->config(
'Controller::Login' => {
login_form_args => {
authenticate_args => { status => 1 },
},
},
};
AUTHORS
See CatalystX::SimpleLogin for authors.
LICENSE
See CatalystX::SimpleLogin for license.
perl v5.14.2 2011-09-05 CatalystX::SimpleLogin::Form::Login(3pm)