Cataly...::Login(3pm)
π NAME π
ok so bestie, welcome to CatalystX::SimpleLogin::Form::Login β it's the validation for the login form β¨ (from the User Contributed Perl Documentation, perl v5.36.0, if you were clocking the vibe).
πΈ DESCRIPTION πΈ
It's an HTML::FormHandler form, but make it login. That's it. That's the whole assignment. It handles the login form for you and it ate π
π FIELDS π
these are the little input babies this form ships with, no cap:
usernameβ your name, bestie π«Άpasswordβ the secret one πrememberβ the "keep me logged in" checkbox energysubmitβ the button that actually does the thing π
β¨ METHODS β¨
the methods it's serving:
validateβ checks your input, does the vibe check πadd_auth_errorsβ adds the auth errors in π
π¦ SEE ALSO π¦
go check out CatalystX::SimpleLogin::Controller::Login β that's the main character this form is besties with π
π CUSTOMIZATION π
changing the field names, lowkey
By default, the params passed to authenticate() are 'username' and 'password'. So like, default behaviour, standard stuff. But 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' β fr fr, those are the exact key names, don't freestyle them.
__PACKAGE__->config(
'Controller::Login' => {
login_form_args => {
authenticate_username_field_name => 'name',
authenticate_password_field_name => 'password2',
},
},
);
changing how it looks, highkey iconic
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' },
]
}
},
);
adding more fields β¨
Additional fields can be added β yes, you can just keep going:
field_list => [
'foo' => ( type => 'MyField' ),
'bar' => { type => 'Text' },
]
extra args to authenticate π§
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 (yeah that's the original's spacing, we keep it verbatim bestie, the facts do not change π):
__PACKAGE__->config(
'Controller::Login' => {
login_form_args => {
authenticate_args => { status => 1 },
},
},
);
π AUTHORS π
See CatalystX::SimpleLogin for authors.
π LICENSE π
See CatalystX::SimpleLogin for license. (go read it, periodt)
ok that's the whole page, we're done here π
perl v5.36.0 Β· 2022-08-28 Β· Cataly...::Login(3pm) β mwah, byeee πβ¨π¦
π¦ where this page comes from
- ubuntu noble: libcatalystx-simplelogin-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalystx-simplelogin-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalystx-simplelogin-perl 0.21-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms