From 14f3182e172ff503d4d686e6cd55f54cce313288 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Thu, 3 Sep 2020 13:09:43 +0530 Subject: [PATCH] :bug: Change scopes type in access token, API key --- src/controllers/groups/_id/api-keys.ts | 4 ++-- src/controllers/users/_id/access-tokens.ts | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/controllers/groups/_id/api-keys.ts b/src/controllers/groups/_id/api-keys.ts index 8122dc2dc..a9d36d91f 100644 --- a/src/controllers/groups/_id/api-keys.ts +++ b/src/controllers/groups/_id/api-keys.ts @@ -39,7 +39,7 @@ export class GroupApiKeysController { @Middleware( validator( { - scopes: Joi.string(), + scopes: Joi.array().items(Joi.string()), ipRestrictions: Joi.string(), referrerRestrictions: Joi.string(), name: Joi.string(), @@ -78,7 +78,7 @@ export class GroupApiKeysController { @Middleware( validator( { - scopes: Joi.string().allow(null), + scopes: Joi.array().items(Joi.string()).allow(null), ipRestrictions: Joi.string().allow(null), referrerRestrictions: Joi.string().allow(null), name: Joi.string().allow(null), diff --git a/src/controllers/users/_id/access-tokens.ts b/src/controllers/users/_id/access-tokens.ts index 660166f68..79962fb17 100644 --- a/src/controllers/users/_id/access-tokens.ts +++ b/src/controllers/users/_id/access-tokens.ts @@ -43,10 +43,9 @@ export class UserAccessTokensController { @Middleware( validator( { - scopes: Joi.string(), + scopes: Joi.array().items(Joi.string()), name: Joi.string(), description: Joi.string(), - expiresAt: Joi.string(), }, "body" ) @@ -90,10 +89,9 @@ export class UserAccessTokensController { @Middleware( validator( { - scopes: Joi.string().allow(null), + scopes: Joi.array().items(Joi.string()).allow(null), name: Joi.string().allow(null), description: Joi.string().allow(null), - expiresAt: Joi.string(), }, "body" )