From 32cc2f0f81c45e913d2cf44524a7676315719549 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 22 Mar 2019 16:56:49 +0100 Subject: More refactoring --- lib/Travelynx/Controller/Api.pm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/Travelynx/Controller/Api.pm') diff --git a/lib/Travelynx/Controller/Api.pm b/lib/Travelynx/Controller/Api.pm index 435c644..c3eccb8 100755 --- a/lib/Travelynx/Controller/Api.pm +++ b/lib/Travelynx/Controller/Api.pm @@ -4,13 +4,6 @@ use Mojo::Base 'Mojolicious::Controller'; use Travel::Status::DE::IRIS::Stations; use UUID::Tiny qw(:std); -my %token_type = ( - status => 1, - history => 2, - action => 3, -); -my @token_types = (qw(status history action)); - sub make_token { return create_uuid_as_string(UUID_V4); } @@ -105,7 +98,7 @@ sub set_token { return; } my $token = make_token(); - my $token_id = $token_type{ $self->param('token') }; + my $token_id = $self->app->token_type->{ $self->param('token') }; if ( not $token_id ) { $self->redirect_to('account'); -- cgit v1.2.3