This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Foodloop-Server/lib/Pear/LocalLoop/Controller/Api/V1/Customer.pm

22 lines
410 B
Perl
Raw Permalink Normal View History

package Pear::LocalLoop::Controller::Api::V1::Customer;
use Mojo::Base 'Mojolicious::Controller';
sub auth {
2021-03-20 12:09:50 +00:00
my $c = shift;
2021-03-20 12:09:50 +00:00
return 1 if $c->stash->{api_user}->type eq 'customer';
2021-03-20 12:09:50 +00:00
$c->render(
json => {
success => Mojo::JSON->false,
message => 'Not an Customer',
error => 'user_not_cust',
},
status => 403,
);
2021-03-20 12:09:50 +00:00
return 0;
}
1;