Mojoli...icAuth(3pm)

πŸ“¦
version 0.08 Β· 2 versions
  • 0.08 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.08 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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