Added debug code

This commit is contained in:
piratefinn 2016-09-15 18:08:33 +01:00
parent c967098d05
commit 1f23c616f7

View file

@ -66,12 +66,15 @@ post '/register' => sub {
my $account = $self->get_account_by_username( $json->{username} ); 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 ) { unless ( defined $account ) {
return $self->render( json => { return $self->render( json => {
success => Mojo::JSON->false, success => Mojo::JSON->false,
message => 'Username not recognised, has your token expired?', message => 'Username not recognised, has your token expired?',
}); });
} elsif ( $account->{keyused} eq 't' ) { } elsif ( $account->{keyused} ) {
return $self->render( json => { return $self->render( json => {
success => Mojo::JSON->false, success => Mojo::JSON->false,
message => 'Token has already been used', message => 'Token has already been used',