Cataly...::Login(3pm)

πŸ“¦
version 0.21 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 energy
  • submit β€” 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