Mojoli...icAuth(3pm)
π Mojolicious::Plugin::BasicAuth β ok bestie, let's talk β¨
(that's the manual page name up there, from the User Contributed Perl Documentation, periodt)
πΈ NAME πΈ
Mojolicious::Plugin::BasicAuth β Basic HTTP Auth Helper π
β¨ DESCRIPTION β¨
okay so. Mojolicous::Plugin::BasicAuth (yes that's how it's spelled in here, don't @ me, it's literally what the page says π«Ά) is a helper for basic http authentication. that's it. that's the whole vibe. it helps you do basic http auth and it does it well. π
π¦ USAGE π¦
here's the moment you've all been waiting for:
use Mojolicious::Lite;
plugin 'basic_auth';
get '/' => sub {
my $self = shift;
return $self->render_text('ok')
if $self->basic_auth(
realm => sub { return 1 if "@_" eq 'username password' }
);
};
app->start;
like?? look at her go π she's pulling basic_auth, she's checking the realm with a lil sub that returns 1 when "@_" is exactly 'username password', she's rendering 'ok'. main character energy fr fr. π
π METHODS π
Mojolicious::Plugin::BasicAuth inherits all methods from Mojolicious::Plugin and implements the following new ones. so it's giving... nepo baby but make it useful. π
β register β
$plugin->register;
Register condition in Mojolicious application. that's the whole job. iconic behavior honestly.
π SEE ALSO π
Mojoliciousβ go read that one too, bestie, iykyk
π DEVELOPMENT π
(the link is literally right there, go be nosy, i support it π§)
π VERSION π
0.06
π CREDITS π
Kirill Miazine πΈ
π AUTHOR π
Glen Hinkle tempire@cpan.org
ngl if you made it this far you're a real one. go forth and authenticate. π«Άβ¨
okay so that's the whole page bestie!! this was perl v5.34.0, dated 2022-06-15, and it's giving User Contributed Perl Documentation for Mojoli...icAuth(3pm) π byeeee π
π¦ where this page comes from
- debian bookworm: libmojolicious-plugin-basicauth-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmojolicious-plugin-basicauth-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmojolicious-plugin-basicauth-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmojolicious-plugin-basicauth-perl 0.08-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmojolicious-plugin-basicauth-perl 0.08-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