catalystx::simplelogin::traitfor::controller::login::logout(3pm) [debian man page]
CatalystX::SimpleLogin::TraitFor::Controller::Login::LogUser3Contributed Perl DocuCatalystX::SimpleLogin::TraitFor::Controller::Login::Logout(3pm)NAME
CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout - log users out
DESCRIPTION
Simple controller role for logging users out. Provides a "logout" action (at /logout by default) which redirects the user to the homepage
by default.
ACTIONS
logout : Chained('/') PathPart('logout') Args(0)
Calls "$c->logout", then redirects to the logout uri retuned by "$self->redirect_after_logout_uri".
METHODS
redirect_after_logout_uri
Returns the uri to redirect to after logout.
Defaults to "$c->uri_for('/');" you can override this by setting the "<redirect_after_logout_uri"> key in config to a path to be passed to
"$c->uri_for".
Alternatively, you can write your own redirect_after_logout_uri in your Login controller if you are extending CatalystX::SimpleLogin and it
will override the method from this role.
do_clear_session_on_logout
Deletes the session after a logout.
To enable this use the following in your config:
__PACKAGE__->config('Controller::Login' => { clear_session_on_logout => 1 });
SEE ALSO
CatalystX::SimpleLogin::Controller::Login
AUTHORS
See CatalystX::SimpleLogin for authors.
LICENSE
See CatalystX::SimpleLogin for license.
perl v5.14.2 2012-05-05 CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout(3pm)
Check Out this Related Man Page
CatalystX::SimpleLogin(3pm) User Contributed Perl Documentation CatalystX::SimpleLogin(3pm)NAME
CatalystX::SimpleLogin - Provide a simple Login controller which can be reused
SYNOPSIS
package MyApp;
use Moose;
use namespace::autoclean;
use Catalyst qw/
+CatalystX::SimpleLogin
Authentication
Session
Session::State::Cookie
Session::Store::File
/;
extends 'Catalyst';
__PACKAGE__->config(
'Plugin::Authentication' => { # Auth config here }
);
__PACKAGE__->config(
'Controller::Login' => { # SimpleLogin config here }
);
__PACKAGE__->setup;
ATTENTION!
If you're new here, you should start by reading CatalystX::SimpleLogin::Manual, which provides a gentler introduction to using this code.
Come back here when you're done there.
DESCRIPTION
CatalystX::SimpleLogin is an application class Moose::Role which will inject a Catalyst::Controller which is an instance of
CatalystX::SimpleLogin::Controller::Login into your application. This provides a simple login and logout page with the adition of only one
line of code and one template to your application.
REQUIREMENTS
A Catalyst application
Working authentication configuration
Working session configuration
A view
CUSTOMISATION
CatalystX::SimpleLogin is a prototype for CatalystX::Elements. As such, one of the goals is to make it easy for users to customise the
provided component to the maximum degree possible, and also, to have a linear relationship between effort invested and level of
customisation achieved.
Three traits are shipped with SimpleLogin: WithRedirect, Logout, and RenderAsTTTemplate. These traits are set in the config:
__PACKAGE__->config(
'Controller::Login' => {
traits => [qw/ Logout WithRedirect RenderAsTTTemplate /],
login_form_args => { # see the login form },
);
COMPONENTS
o CatalystX::SimpleLogin::Controller::Login - first point of call for customisation. Override the action configs to reconfigure the
paths of the login or logout actions. Subclass to be able to apply method modifiers to run before / after the login or logout actions
or override methods.
o CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout - provides the "logout" action and associated methods. You can compose this
manually yourself if you want just that action.
This trait is set by default, but if you set another trait in your config, you will have to include it.
o CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect - provides the "login" action with a wrapper to redirect to a page
which needs authentication, from which the user was previously redirected. Goes hand in hand with Catalyst::ActionRole::NeedsLogin
o CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate - sets the stash variable 'template' to point to a string
reference containing the rendered template so that it's not necessary to have a login.tt template file.
o CatalystX::SimpleLogin::Form::Login - the HTML::FormHandler form for the login form.
o Catalyst::ActionRole::NeedsLogin - Used to cause a specific path to redirect to the login page if a user is not authenticated.
TODO
Here's a list of what I think needs working on, in no particular order.
Please feel free to add to or re-arrange this list :)
Fix extension documentation
Document all this stuff.
Examples of use / customisation in documentation
Fixing one uninitialized value warning in LoginRedirect
Disable the use of NeedsLogin ActionRole when WithRedirect is not loaded
SOURCE CODE
http://github.com/bobtfish/catalystx-simplelogin/tree/master
git://github.com/bobtfish/catalystx-simplelogin.git
Forks and patches are welcome. #formhandler or #catalyst (irc.perl.org) are both good places to ask about using or developing this code.
SEE ALSO
o Catalyst
o Moose and Moose::Role
o MooseX::MethodAttributes::Role - Actions composed from Moose::Role.
o CatalystX::InjectComponent - Injects the controller class
o HTML::FormHandler - Generates the login form
o Catalyst::Plugin::Authentication - Responsible for the actual heavy lifting of authenticating the user
o Catalyst::Plugin::Session
o Catalyst::Controller - Allows you to decorate actions with roles (E.g Catalyst::ActionRole::NeedsLogin)
o CatalystX::Component::Traits - Allows Moose::Role to be composed onto components from config
AUTHORS
Tomas Doran (t0m) "bobtfish@bobtfish.net"
Zbigniew Lukasiak
Stephan Jauernick (stephan48) "stephan@stejau.de"
Gerda Shank (gshank) "gshank@cpan.org"
Florian Ragwitz "rafl@debian.org"
Shlomi Fish
Oleg Kostyuk (cub-uanic) "cub@cpan.org"
LICENSE
Copyright 2009 Tomas Doran. Some rights reserved.
This sofware is free software, and is licensed under the same terms as perl itself.
perl v5.14.2 2012-07-15 CatalystX::SimpleLogin(3pm)