diff options
author | Jannis M. Hoffmann <jannis@fehcom.de> | 2022-11-16 23:14:10 +0100 |
---|---|---|
committer | Jannis M. Hoffmann <jannis@fehcom.de> | 2022-11-16 23:14:10 +0100 |
commit | d0ffe11bd365b68d4da252b39d06d99f75d8cacb (patch) | |
tree | 17b852052b6515864d7963b49b2ac3ee2c3df134 /lib/JWebmail.pm | |
parent | a52a7d7c27440a7c2716af033a6113abcaa2bd46 (diff) |
minor cleanup and fixes
Diffstat (limited to 'lib/JWebmail.pm')
-rw-r--r-- | lib/JWebmail.pm | 14 |
1 files changed, 9 insertions, 5 deletions
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); } |