Cataly...:Logout(3pm)
β¨ 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
- 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