From d0ffe11bd365b68d4da252b39d06d99f75d8cacb Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Wed, 16 Nov 2022 23:14:10 +0100 Subject: minor cleanup and fixes --- lib/JWebmail.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/JWebmail.pm') diff --git a/lib/JWebmail.pm b/lib/JWebmail.pm index 8c01596..1c66001 100644 --- a/lib/JWebmail.pm +++ b/lib/JWebmail.pm @@ -39,8 +39,7 @@ sub startup { $self->moniker('jwebmail'); - my $mode = $self->mode; - $self->log->path($self->home->child('log', "$mode.log")); + $self->log->path($self->home->child('log', $self->mode . '.log')); # load plugins push @{$self->plugins->namespaces}, 'JWebmail::Plugin'; @@ -57,10 +56,10 @@ sub startup { # initialize models my $read_mails = do { - if ($mode eq 'development') { + if ($self->mode eq 'development') { my $cls = $self->config->{development}{read_mock}; eval { load $cls; 1 } || die "Issue for module $cls with: $@"; - $cls->new; + $cls->new(); } else { JWebmail::Model::ReadMails::QMailAuthuser->new( @@ -72,10 +71,15 @@ sub startup { unless $read_mails->DOES('JWebmail::Model::ReadMails::Role'); $self->helper(users => sub { $read_mails }); $self->helper(send_mail => sub { my ($c, $mail) = @_; JWebmail::Model::WriteMails::sendmail($mail) }); - $JWebmail::Model::WriteMails::Block_Writes = 1 if $mode eq 'development'; + $JWebmail::Model::WriteMails::Block_Writes = 1 if $self->mode eq 'development'; $self->defaults(version => __PACKAGE__->VERSION); + $self->sessions->cookie_name('jwebmail_session'); + $self->sessions->samesite('Strict'); + $self->sessions->secure(1); + $self->sessions->default_expiration(30 * 60); + $self->route($i18n_route); } -- cgit v1.2.3