Api: Fix 'uninitialized value' warning when no token is set
This commit is contained in:
parent
cf7f993309
commit
04d096014e
1 changed files with 4 additions and 1 deletions
|
@ -71,7 +71,10 @@ sub get_v1 {
|
||||||
}
|
}
|
||||||
|
|
||||||
my $token = $self->get_api_token($uid);
|
my $token = $self->get_api_token($uid);
|
||||||
if ( $api_token ne $token->{$api_action} ) {
|
if ( not $api_token
|
||||||
|
or not $token->{$api_action}
|
||||||
|
or $api_token ne $token->{$api_action} )
|
||||||
|
{
|
||||||
$self->render(
|
$self->render(
|
||||||
json => {
|
json => {
|
||||||
error => 'Invalid token',
|
error => 'Invalid token',
|
||||||
|
|
Loading…
Reference in a new issue