From e461de75b26e74c0d8c154a1a17d6019c2be30dd Mon Sep 17 00:00:00 2001 From: M Somerville Date: Fri, 7 Aug 2020 20:02:17 +0100 Subject: Offline process for CSV generation. Include a status page, the option for access token requests to use this system, and a script for manual generation. --- perllib/Catalyst/Authentication/Credential/AccessToken.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'perllib/Catalyst/Authentication/Credential/AccessToken.pm') diff --git a/perllib/Catalyst/Authentication/Credential/AccessToken.pm b/perllib/Catalyst/Authentication/Credential/AccessToken.pm index 24398823d..39364ad99 100644 --- a/perllib/Catalyst/Authentication/Credential/AccessToken.pm +++ b/perllib/Catalyst/Authentication/Credential/AccessToken.pm @@ -15,12 +15,18 @@ sub new { return $self; } -sub authenticate { - my ( $self, $c, $realm, $authinfo_ignored ) = @_; - +sub get_token { + my ($self, $c) = @_; my $auth_header = $c->req->header('Authorization') || ''; my ($token) = $auth_header =~ /^Bearer (.*)/i; $token ||= $c->get_param('access_token'); + return $token; +} + +sub authenticate { + my ( $self, $c, $realm, $authinfo_ignored ) = @_; + + my $token = $self->get_token($c); return unless $token; my $id; -- cgit v1.2.3