.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "CatalystX::SimpleLogin::Controller::Login 3pm" .TH CatalystX::SimpleLogin::Controller::Login 3pm "2017-08-26" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" CatalystX::SimpleLogin::Controller::Login \- Configurable login controller .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 10 \& # For simple useage exmple, see CatalystX::SimpleLogin, this is a \& # full config example \& _\|_PACKAGE_\|_\->config( \& \*(AqController::Login\*(Aq => { \& traits => [ \& \*(AqWithRedirect\*(Aq, # Optional, enables redirect\-back feature \& \*(Aq\-RenderAsTTTemplate\*(Aq, # Optional, allows you to use your own template \& ], \& actions => { \& login => { # Also optional \& PathPart => [\*(Aqtheloginpage\*(Aq], # Change login action to /theloginpage \& }, \& }, \& }, \& ); .Ve .PP See CatalystX::SimpleLogin::Form::Login for configuring the form. .SH "DESCRIPTION" .IX Header "DESCRIPTION" Controller base class which exists to have login roles composed onto it for the login and logout actions. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "login_form_class" .IX Subsection "login_form_class" A class attribute containing the class of the form to be initialised. One can override it in a derived class with the class of a new form, possibly subclassing CatalystX::SimpleLogin::Form::Login. For example: .PP .Vb 1 \& package MyApp::Controller::Login; \& \& use Moose; \& \& extends(\*(AqCatalystX::SimpleLogin::Controller::Login\*(Aq); \& \& has \*(Aq+login_form_class\*(Aq => ( \& default => "MyApp::Form::Login", \& ); \& \& 1; .Ve .SS "login_form_class_roles" .IX Subsection "login_form_class_roles" An attribute containing an array reference of roles to be consumed by the form. One can override it in a similar way to \f(CW\*(C`login_form_class\*(C'\fR: .PP .Vb 1 \& package MyApp::Controller::Login; \& \& use Moose; \& \& extends(\*(AqCatalystX::SimpleLogin::Controller::Login\*(Aq); \& \& has \*(Aq+login_form_class_roles\*(Aq => ( \& default => sub { [qw(MyApp::FormRole::Foo MyApp::FormRole::Bar)] }, \& ); \& \& 1; .Ve .SH "METHODS" .IX Header "METHODS" .SS "\s-1BUILD\s0" .IX Subsection "BUILD" Cause form instance to be built at application startup. .SS "do_post_login_redirect" .IX Subsection "do_post_login_redirect" This method does a post-login redirect. \fB\s-1TODO\s0\fR for \s-1BOBTFISH\s0 \- should it even be public? If it does need to be public, then document it because the Pod coverage test failed. .SS "login" .IX Subsection "login" Login action. .SS "login_redirect" .IX Subsection "login_redirect" Redirect to the login action. .SS "login_GET" .IX Subsection "login_GET" Displays the login form .SS "login_POST" .IX Subsection "login_POST" Processes a submitted login form, and if correct, logs the user in and redirects .SS "not_required" .IX Subsection "not_required" A stub action that is anchored at the root of the site (\*(L"/\*(R") and does not require registration (hence the name). .SS "redirect_after_login_uri" .IX Subsection "redirect_after_login_uri" If you are using WithRedirect (i.e. by default), then this method is overridden to redirect the user back to the page they initially hit which required authentication. .PP Note that even if the original \s-1URI\s0 was a post, then the redirect back will only be a \s-1GET.\s0 .PP If you choose \fB\s-1NOT\s0\fR to compose the WithRedirect trait, then you can set the uri users are redirected to with the \f(CW\*(C`redirect_after_login_uri\*(C'\fR config key, or by overriding the redirect_after_login_uri method in your own login controller if you need custom logic. .SS "render_login_form" .IX Subsection "render_login_form" Renders the login form. By default it just calls the form's render method. If you want to do something different, like rendering the form with a template through your view, this is the place to hook into. .SS "required" .IX Subsection "required" A stub action that is anchored at the root of the site (\*(L"/\*(R") and does require registration (hence the name). .SS "remember_me" .IX Subsection "remember_me" An action that is called to deal with whether the remember me flag has been set or not. If it has been it extends the session expiry time. .PP This is only called if there was a successful login so if you want a hook into that part of the process this is a good place to hook into. .PP It is also obviously a good place to hook into if you want to change the behaviour of the remember me flag. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect" 4 .IX Item "CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect" .PD 0 .IP "CatalystX::SimpleLogin::Form::Login" 4 .IX Item "CatalystX::SimpleLogin::Form::Login" .PD .SH "AUTHORS" .IX Header "AUTHORS" See CatalystX::SimpleLogin for authors. .SH "LICENSE" .IX Header "LICENSE" See CatalystX::SimpleLogin for license.