1CatalystX::SimpleLogin:U:sCeorntCroonltlreirb:uC:taLetodagliPynes(rt3lX):D:oSciummpelnetLaotgiionn::Controller::Login(3)
2
3
4
6 CatalystX::SimpleLogin::Controller::Login - Configurable login
7 controller
8
10 # For simple useage exmple, see CatalystX::SimpleLogin, this is a
11 # full config example
12 __PACKAGE__->config(
13 'Controller::Login' => {
14 traits => [
15 'WithRedirect', # Optional, enables redirect-back feature
16 '-RenderAsTTTemplate', # Optional, allows you to use your own template
17 ],
18 actions => {
19 login => { # Also optional
20 PathPart => ['theloginpage'], # Change login action to /theloginpage
21 },
22 },
23 },
24 );
25
26 See CatalystX::SimpleLogin::Form::Login for configuring the form.
27
29 Controller base class which exists to have login roles composed onto it
30 for the login and logout actions.
31
33 login_form_class
34 A class attribute containing the class of the form to be initialised.
35 One can override it in a derived class with the class of a new form,
36 possibly subclassing CatalystX::SimpleLogin::Form::Login. For example:
37
38 package MyApp::Controller::Login;
39
40 use Moose;
41
42 extends('CatalystX::SimpleLogin::Controller::Login');
43
44 has '+login_form_class' => (
45 default => "MyApp::Form::Login",
46 );
47
48 1;
49
50 login_form_class_roles
51 An attribute containing an array reference of roles to be consumed by
52 the form. One can override it in a similar way to "login_form_class":
53
54 package MyApp::Controller::Login;
55
56 use Moose;
57
58 extends('CatalystX::SimpleLogin::Controller::Login');
59
60 has '+login_form_class_roles' => (
61 default => sub { [qw(MyApp::FormRole::Foo MyApp::FormRole::Bar)] },
62 );
63
64 1;
65
67 BUILD
68 Cause form instance to be built at application startup.
69
70 do_post_login_redirect
71 This method does a post-login redirect. TODO for BOBTFISH - should it
72 even be public? If it does need to be public, then document it because
73 the Pod coverage test failed.
74
75 login
76 Login action.
77
78 login_redirect
79 Redirect to the login action.
80
81 login_GET
82 Displays the login form
83
84 login_POST
85 Processes a submitted login form, and if correct, logs the user in and
86 redirects
87
88 not_required
89 A stub action that is anchored at the root of the site ("/") and does
90 not require registration (hence the name).
91
92 redirect_after_login_uri
93 If you are using WithRedirect (i.e. by default), then this method is
94 overridden to redirect the user back to the page they initially hit
95 which required authentication.
96
97 Note that even if the original URI was a post, then the redirect back
98 will only be a GET.
99
100 If you choose NOT to compose the WithRedirect trait, then you can set
101 the uri users are redirected to with the "redirect_after_login_uri"
102 config key, or by overriding the redirect_after_login_uri method in
103 your own login controller if you need custom logic.
104
105 render_login_form
106 Renders the login form. By default it just calls the form's render
107 method. If you want to do something different, like rendering the form
108 with a template through your view, this is the place to hook into.
109
110 required
111 A stub action that is anchored at the root of the site ("/") and does
112 require registration (hence the name).
113
114 remember_me
115 An action that is called to deal with whether the remember me flag has
116 been set or not. If it has been it extends the session expiry time.
117
118 This is only called if there was a successful login so if you want a
119 hook into that part of the process this is a good place to hook into.
120
121 It is also obviously a good place to hook into if you want to change
122 the behaviour of the remember me flag.
123
125 CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect
126 CatalystX::SimpleLogin::Form::Login
127
129 See CatalystX::SimpleLogin for authors.
130
132 See CatalystX::SimpleLogin for license.
133
134
135
136perl v5.30.1 2C0a2t0a-l0y1s-t2X9::SimpleLogin::Controller::Login(3)