From 4923da252fc34ec736953212f0bc173bedaaa0bf Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Oct 07 2019 22:55:36 +0000 Subject: Merge branch 'fix-159' into 'development' 🐛 — Fix #159 — Problem with badly detected URLs in mail sending See merge request fiat-tux/hat-softwares/lufi!40 --- 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');