aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-22 11:21:15 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-29 15:53:27 +0000
commit32a4a1455032e954301b1d129d9c70c6bce9606d (patch)
tree0179df2aeec3239c5006a720fb531942a173649b /perllib/FixMyStreet/App.pm
parent5d485f64d864b236fdfaba1c3cbf452a7331b18d (diff)
Add an access token authentication credential.
This allows access if you have a token associated with your user.
Diffstat (limited to 'perllib/FixMyStreet/App.pm')
-rw-r--r--perllib/FixMyStreet/App.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index 1eb197e38..e47336b7c 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -81,6 +81,19 @@ __PACKAGE__->config(
user_model => 'DB::User',
},
},
+ access_token => {
+ use_session => 0,
+ credential => {
+ class => 'AccessToken',
+ token_field => 'extra',
+ # This means the token has to be 18 characters long (as generated by AuthToken)
+ token_lookup => { like => "%access_token,T18:TOKEN,%" },
+ },
+ store => {
+ class => 'DBIx::Class',
+ user_model => 'DB::User',
+ },
+ },
},
);