summaryrefslogtreecommitdiff
path: root/lib/Travelynx/Controller/Api.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travelynx/Controller/Api.pm')
-rwxr-xr-xlib/Travelynx/Controller/Api.pm22
1 files changed, 22 insertions, 0 deletions
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{ ^ (?<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 ) {