From 69f961a23cb8a2196d5315105eb4a72764625351 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 17 Dec 2019 20:46:17 +0100 Subject: disable import and checkin API endpoints in production mode --- lib/Travelynx/Controller/Api.pm | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/Travelynx/Controller/Api.pm') diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm index 42e4774..f541c98 100755 --- a/lib/Travelynx/Controller/Api.pm +++ b/lib/Travelynx/Controller/Api.pm @@ -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{ ^ (? \d+ ) - (? .* ) $ }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{ ^ (? \d+ ) - (? .* ) $ }x ) { -- cgit v1.2.3