From c967098d0596a30758712b4deb00ead2ef1d35f0 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 15 Sep 2016 16:56:04 +0100 Subject: [PATCH] Added some log endpoints --- foodloopserver.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/foodloopserver.pl b/foodloopserver.pl index 50475c0..cd0d5e4 100644 --- a/foodloopserver.pl +++ b/foodloopserver.pl @@ -6,6 +6,7 @@ use Mojolicious::Lite; use Data::UUID; use Devel::Dwarn; use Mojo::JSON; +use Data::Dumper; # connect to database use DBI; @@ -119,8 +120,11 @@ post '/token' => sub { my $account = $self->get_account_by_token( $json->{token} ); + $self->app->log->debug( "Account: " . Dumper $account ); + # TODO change to proper boolean checks if ( ! defined $account || $account->{keyused} ) { + $self->app->log->info("unrecognised or preused token: [" . $json->{token} . "]"); return $self->render( json => { success => Mojo::JSON->false, message => 'Token is invalid or has already been used',