From 3e3e84d6f48879709c65b1cc72c6f16fe7b5ae99 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Tue, 8 Oct 2019 00:47:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20#159=20?= =?UTF-8?q?=E2=80=94=20Problem=20with=20badly=20detected=20URLs=20in=20mai?= =?UTF-8?q?l=20sending?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 2 ++ lib/Lufi.pm | 1 + lib/Lufi/Controller/Auth.pm | 8 ++++---- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6932d8d..fb51011 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,8 @@ Revision history for Lufi button) (#166) - Change row color on hover - Fix typo that leads to error in Safari (#164) + - Fix (for good, I hope) the problem with badly detected URLs in mail + sending (#159) 0.04.3 2019-09 29 - Translate dates in invitations (#161) diff --git a/lib/Lufi.pm b/lib/Lufi.pm index bd0309f..ffadf77 100644 --- a/lib/Lufi.pm +++ b/lib/Lufi.pm @@ -25,6 +25,7 @@ sub startup { die 'You need to provide an email address or an URL as report information in lufi.conf!'; } + $self->config('prefix', $self->config('prefix').'/') unless substr($self->config('prefix'), -1) eq '/'; # Themes handling $self->plugin('FiatTux::Themes'); diff --git a/lib/Lufi/Controller/Auth.pm b/lib/Lufi/Controller/Auth.pm index 8f257cb..7405694 100644 --- a/lib/Lufi/Controller/Auth.pm +++ b/lib/Lufi/Controller/Auth.pm @@ -4,10 +4,10 @@ use Mojo::Base 'Mojolicious::Controller'; sub login_page { my $c = shift; - my $redirect = $c->param('redirect') // 'index'; + my $redirect = $c->param('redirect') // '/'; if ($c->is_user_authenticated) { - $c->redirect_to('index'); + $c->redirect_to('/'); } else { $c->render( template => 'login', @@ -21,7 +21,7 @@ sub login { my $login = $c->param('login'); my $pwd = $c->param('password'); - my $redirect = $c->param('redirect') // 'index'; + my $redirect = $c->param('redirect') // '/'; if ($c->validation->csrf_protect->has_error('csrf_token')) { $c->stash(msg => $c->l('Bad CSRF token.')); @@ -33,7 +33,7 @@ sub login { } elsif ($redirect eq 'my_invitations') { return $c->redirect_to('invite_list'); } - return $c->redirect_to('index'); + return $c->redirect_to('/'); } else { $c->stash(msg => $c->l('Please, check your credentials or your right to access this service: unable to authenticate.')); $c->render(template => 'login');