Cataly...:Logout(3pm)

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

✨ CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout ✨

okay bestie, so this one is a CatalystX::SimpleLogin trait β€” a Perl module, (3pm) manual, and it lives in the TraitFor::Controller::Login namespace under CatalystX::SimpleLogin. It's the Logout one. You already know what it does from the name but let me say it anyway πŸ’…


🌸 NAME 🌸

CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout β€” literally just logging users out. that's it. that's the whole job. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

It's a simple controller role whose entire main character era is logging users out. It hands you a "logout" action β€” which sits at /logout by default, no cap β€” and that action redirects the user to the homepage. also by default. defaults everywhere, we love a low-maintenance icon ✨


πŸŽ€ ACTIONS πŸŽ€

⭐ logout : Chained('/') PathPart('logout') Args(0)

So the way this works: it calls $c->logout first, and then it redirects over to whatever logout uri gets returned by $self->redirect_after_logout_uri. that's the whole flow. serve, log out, redirect, slay. πŸ’…


πŸ’– METHODS πŸ’–

🌈 redirect_after_logout_uri

Returns the uri to redirect to after logout. yes bestie, it's giving navigator. it tells you where to go next 🧚

It defaults to $c->uri_for('/'); β€” iconic, predictable, home sweet home. But you can override it by setting the <redirect_after_logout_uri"> key in config to a path, and that path gets passed straight into $c->uri_for.

OR, if you're feeling extra: you can write your own redirect_after_logout_uri inside your Login controller if you're extending CatalystX::SimpleLogin. Do that and it will override the method from this role. you're the main character now, go off πŸ‘‘

🌸 do_clear_session_on_logout

Deletes the session after a logout. bye bye session data, you will not be missed πŸ’€

To enable this, pop the following in your config:

__PACKAGE__->config('Controller::Login' => { clear_session_on_logout => 1 });

that's it. one little flag and the session is GONE. periodt. ✨


πŸ”₯ SEE ALSO πŸ”₯

  • CatalystX::SimpleLogin::Controller::Login

πŸ‘‘ AUTHORS πŸ‘‘

See CatalystX::SimpleLogin for authors. (they're all listed over there, iykyk πŸ’œ)


πŸ“ LICENSE πŸ“

See CatalystX::SimpleLogin for license. πŸŽ€


ngl, this page is short and sweet and i'm obsessed with it. everything you need, nothing you don't, and it still ate. πŸ’…

okay bye bestie, this was documented with perl v5.36.0, dated 2022-08-28, and it's part of the Cataly...:Logout(3pm) page β€” go log somebody out, you got this 🫢✨🌸

πŸ“¦ where this page comes from