From b6064cc985759b779c3b20fe44f29e9bf55b9834 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Tue, 4 Apr 2017 22:21:57 +0100 Subject: [PATCH] Added header for use during dev --- lib/Pear/LocalLoop.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Pear/LocalLoop.pm b/lib/Pear/LocalLoop.pm index e670a81..78d36fa 100644 --- a/lib/Pear/LocalLoop.pm +++ b/lib/Pear/LocalLoop.pm @@ -2,7 +2,6 @@ package Pear::LocalLoop; use Mojo::Base 'Mojolicious'; use Data::UUID; -use Devel::Dwarn; use Mojo::JSON; use Data::Dumper; use Email::Valid; @@ -34,8 +33,6 @@ my $sessionTimeSeconds = 60 * 60 * 24 * 7; #1 week. my $sessionTokenJsonName = 'sessionToken'; my $sessionExpiresJsonName = 'sessionExpires'; -Dwarn $config; - # shortcut for use in template $self->helper( db => sub { $dbh }); $self->helper( schema => sub { $schema }); @@ -71,6 +68,9 @@ $r->any( '/' => sub { $self->hook( before_dispatch => sub { my $self = shift; + $self->app->log->debug('Before Dispatch'); + $self->res->headers->header('Access-Control-Allow-Origin' => '*') if $self->app->mode eq 'development'; + $self->remove_all_expired_sessions(); #See if logged in.