Fixed an if statement
This commit is contained in:
parent
b33757dfd8
commit
d0865548ad
1 changed files with 3 additions and 3 deletions
|
@ -120,7 +120,7 @@ post '/token' => sub {
|
||||||
my $account = $self->get_account_by_token( $json->{token} );
|
my $account = $self->get_account_by_token( $json->{token} );
|
||||||
|
|
||||||
# TODO change to proper boolean checks
|
# TODO change to proper boolean checks
|
||||||
if ( ! defined $account || $account->{keyused} eq 't' ) {
|
if ( ! defined $account || $account->{keyused} ) {
|
||||||
return $self->render( json => {
|
return $self->render( json => {
|
||||||
success => Mojo::JSON->false,
|
success => Mojo::JSON->false,
|
||||||
message => 'Token is invalid or has already been used',
|
message => 'Token is invalid or has already been used',
|
||||||
|
@ -136,7 +136,7 @@ helper get_account_by_token => sub {
|
||||||
my ( $self, $token ) = @_;
|
my ( $self, $token ) = @_;
|
||||||
|
|
||||||
return $self->db->selectrow_hashref(
|
return $self->db->selectrow_hashref(
|
||||||
'SELECT keyused, username FROM accounts WHERE idkey = ?',
|
"SELECT keyused, username FROM accounts WHERE idkey = ?",
|
||||||
{},
|
{},
|
||||||
$token,
|
$token,
|
||||||
);
|
);
|
||||||
|
@ -146,7 +146,7 @@ helper get_account_by_username => sub {
|
||||||
my ( $self, $username ) = @_;
|
my ( $self, $username ) = @_;
|
||||||
|
|
||||||
return $self->db->selectrow_hashref(
|
return $self->db->selectrow_hashref(
|
||||||
'SELECT keyused, username FROM accounts WHERE username = ?',
|
"SELECT keyused, username FROM accounts WHERE username = ?",
|
||||||
{},
|
{},
|
||||||
$username,
|
$username,
|
||||||
);
|
);
|
||||||
|
|
Reference in a new issue