From ebe37a68d39dbc1cc4f6af1c05301d5a5fc29c13 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Sun, 1 May 2022 22:35:48 +0200 Subject: mostly renamed 'noaction' to 'login' be carefult with GET vs POST --- lib/JWebmail/Controller/Webmail.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/JWebmail/Controller') diff --git a/lib/JWebmail/Controller/Webmail.pm b/lib/JWebmail/Controller/Webmail.pm index d01abae..ee4a532 100644 --- a/lib/JWebmail/Controller/Webmail.pm +++ b/lib/JWebmail/Controller/Webmail.pm @@ -20,7 +20,9 @@ sub noaction { if ($user) { $self->res->code(307); $self->redirect_to('home'); + return; } + $self->render(action => 'login'); } @@ -71,7 +73,8 @@ sub login { my $passwd = $v->required('password')->size(4, 50)->like(qr/^.+$/)->param; # no new-lines if ($v->has_error) { - return $self->render(action => 'noaction', status => 400); + $self->render(status => 400); + return; } my $auth = $self->users->Auth(user => $user, password => $passwd); @@ -87,7 +90,6 @@ sub login { else { $self->render( status => 401, - action => 'noaction', warning => $self->l('login') . ' ' . $self->l('failed') . '!', ); } @@ -103,7 +105,7 @@ sub logout { # $self->session(expires => 1); $self->res->code(303); - $self->redirect_to('noaction'); + $self->redirect_to('login'); } -- cgit v1.2.3