From d0865548ad1112b070a080196ab9ad3ea9dcbf27 Mon Sep 17 00:00:00 2001 From: piratefinn Date: Mon, 12 Sep 2016 12:27:07 +0100 Subject: [PATCH] Fixed an if statement --- foodloopserver.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/foodloopserver.pl b/foodloopserver.pl index e148604..50475c0 100644 --- a/foodloopserver.pl +++ b/foodloopserver.pl @@ -120,7 +120,7 @@ post '/token' => sub { my $account = $self->get_account_by_token( $json->{token} ); # TODO change to proper boolean checks - if ( ! defined $account || $account->{keyused} eq 't' ) { + if ( ! defined $account || $account->{keyused} ) { return $self->render( json => { success => Mojo::JSON->false, message => 'Token is invalid or has already been used', @@ -136,7 +136,7 @@ helper get_account_by_token => sub { my ( $self, $token ) = @_; return $self->db->selectrow_hashref( - 'SELECT keyused, username FROM accounts WHERE idkey = ?', + "SELECT keyused, username FROM accounts WHERE idkey = ?", {}, $token, ); @@ -146,7 +146,7 @@ helper get_account_by_username => sub { my ( $self, $username ) = @_; return $self->db->selectrow_hashref( - 'SELECT keyused, username FROM accounts WHERE username = ?', + "SELECT keyused, username FROM accounts WHERE username = ?", {}, $username, );