From 1f23c616f7f97e162ab4a52215568429a75a2cb6 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Thu, 15 Sep 2016 18:08:33 +0100 Subject: [PATCH] Added debug code --- foodloopserver.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/foodloopserver.pl b/foodloopserver.pl index cd0d5e4..632846c 100644 --- a/foodloopserver.pl +++ b/foodloopserver.pl @@ -66,12 +66,15 @@ post '/register' => sub { my $account = $self->get_account_by_username( $json->{username} ); + $self->app->log->debug( "Account: " . Dumper $account ); + $self->app->log->debug( "JSON: " . Dumper $json ); + unless ( defined $account ) { return $self->render( json => { success => Mojo::JSON->false, message => 'Username not recognised, has your token expired?', }); - } elsif ( $account->{keyused} eq 't' ) { + } elsif ( $account->{keyused} ) { return $self->render( json => { success => Mojo::JSON->false, message => 'Token has already been used',