[dancer-users] On the TODO list: perhaps make this more configurable (Dancer-Plugin-Auth-Extensible) (RFC)

Henk van Oers hvo.pm at xs4all.nl
Tue Jun 25 20:42:34 BST 2013


This works for me.
No need for 'no_login_handler: 1' in config.yml

diff -u Extensible.pm Extensible.pm.new
--- Extensible.pm	2013-06-25 15:05:39.000000000 +0200
+++ Extensible.pm.new	2013-06-25 21:20:50.000000000 +0200
@@ -12,8 +12,10 @@
  my $settings = plugin_setting;

  my $loginpage = $settings->{login_page} || '/login';
+my $userhomepage = $settings->{user_home_page} || '/';
  my $logoutpage = $settings->{logout_page} || '/logout';
  my $deniedpage = $settings->{denied_page} || '/login/denied';
+my $exitpage = $settings->{exit_page};


  ##Dancer::Logger::warning(<<CHANGEWARNING);
@@ -559,7 +561,7 @@
      if ($success) {
          session logged_in_user => params->{username};
          session logged_in_user_realm => $realm;
-        redirect params->{return_url} || '/';
+        redirect params->{return_url} || $userhomepage;
      } else {
          vars->{login_failed}++;
          forward $loginpage, { login_failed => 1 }, { method => 'GET' 
};
@@ -571,6 +573,8 @@
      session->destroy;
      if (params->{return_url}) {
          redirect params->{return_url};
+    } elsif ($exitpage) {
+        redirect $exitpage;
      } else {
          # TODO: perhaps make this more configurable, perhaps by 
attempting to
          # render a template first.
-------------------

Next on the TODO list: A new default '/login' route.

-- 
Henk


More information about the dancer-users mailing list