From 6d9bee808c7cc1f4153ff5c10d9471d625a3f77f Mon Sep 17 00:00:00 2001 From: Louis Capitanchik <contact@louiscap.co> Date: Sat, 13 Feb 2021 02:00:49 +0000 Subject: [PATCH] Add definitions for oauth scopes --- src/domain/auth/AuthServer.js | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/domain/auth/AuthServer.js b/src/domain/auth/AuthServer.js index d0b21a7..b237b6d 100644 --- a/src/domain/auth/AuthServer.js +++ b/src/domain/auth/AuthServer.js @@ -194,6 +194,8 @@ class KoaOAuthServer { const scopes = describeScopeRequest(query.scope) + console.log(scopes) + return ctx.render('auth/accept-oauth', { user, client, @@ -252,7 +254,32 @@ const scopeDescriptionMap = { icon: 'admin', name: 'Full Access', description: 'Full access to your account, including the ability to create, update and delete any user information, metrics and files.' - } + }, + 'metrics:create': { + name: 'Create Metrics', + description: 'The ability to add data metrics linked to your account. Remember that connected apps that create metrics will know your location!', + }, + 'files:upload': { + name: 'Upload Files', + description: 'The ability to upload images linked to your account', + }, + 'files:read': { + name: 'Read Files', + description: 'The ability to see and download images that you\'ve uploaded to your account', + }, + 'profile:read': { + name: 'Read Profile', + description: 'The ability to see any information associated with your user profile. This includes your name and email address', + }, + 'profile:write': { + name: 'Modify Profile', + description: 'The ability to edit any information associated with your user profile. This includes your name', + }, + 'profile:stats': { + name: 'Profile Stats', + description: 'The ability to see information about your account stats, including your points and citizen scientist level', + }, + } function describeScopeRequest(scope = '*') { const scopes = scope.split(' ') -- GitLab