diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-08-07 20:02:17 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-08-11 14:00:46 +0100 |
commit | e461de75b26e74c0d8c154a1a17d6019c2be30dd (patch) | |
tree | 51c70d22931a7d34cddcf909d850d0af3397c48e /perllib/Catalyst/Authentication/Credential/AccessToken.pm | |
parent | b4d322bf40f88dbab1717e7620178b3641ecd3fa (diff) |
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.
Diffstat (limited to 'perllib/Catalyst/Authentication/Credential/AccessToken.pm')
-rw-r--r-- | perllib/Catalyst/Authentication/Credential/AccessToken.pm | 12 |
1 files changed, 9 insertions, 3 deletions
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; |