disable import and checkin API endpoints in production mode

This commit is contained in:
Daniel Friesel 2019-12-17 20:46:17 +01:00
parent f895d34f31
commit 69f961a23c
3 changed files with 28 additions and 0 deletions

View file

@ -181,6 +181,17 @@ sub travel_v1 {
return;
}
if ( $self->app->mode ne 'development' ) {
$self->render(
json => {
success => \0,
error =>
'This feature is incomplete and only available in development mode',
},
);
return;
}
my $api_token = $payload->{token} // '';
if ( $api_token !~ qr{ ^ (?<id> \d+ ) - (?<token> .* ) $ }x ) {
@ -361,6 +372,17 @@ sub import_v1 {
return;
}
if ( $self->app->mode ne 'development' ) {
$self->render(
json => {
success => \0,
error =>
'This feature is incomplete and only available in development mode',
},
);
return;
}
my $api_token = $payload->{token} // '';
if ( $api_token !~ qr{ ^ (?<id> \d+ ) - (?<token> .* ) $ }x ) {

View file

@ -170,6 +170,7 @@
%= end
</td>
</tr>-->
% if (app->mode eq 'development') {
<tr>
<th scope="row">Travel</th>
<td>
@ -216,6 +217,7 @@
%= end
</td>
</tr>
% }
</table>
</div>
</div>

View file

@ -65,6 +65,8 @@
</div>
</div>
% if (app->mode eq 'development') {
<h2>Travel</h2>
<div class="row">
<div class="col s12">
@ -188,3 +190,5 @@
</p>
</div>
</div>
% }