Commit 69f961a2 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

disable import and checkin API endpoints in production mode

parent f895d34f
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -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 ) {
+2 −0
Original line number Diff line number Diff line
@@ -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>
+4 −0
Original line number Diff line number Diff line
@@ -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>

% }