From 63577fad4bbe48983fb15d687d9c7954047cddae Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Thu, 3 Sep 2020 13:57:37 +0530 Subject: [PATCH] :recycle: Change API key, access token length to 32 --- src/_staart/rest/group.ts | 2 +- src/_staart/rest/user.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_staart/rest/group.ts b/src/_staart/rest/group.ts index 2bacf247a..376af4fe2 100644 --- a/src/_staart/rest/group.ts +++ b/src/_staart/rest/group.ts @@ -887,7 +887,7 @@ export const createApiKeyForUser = async ( ) throw new Error(INSUFFICIENT_PERMISSION); - apiKey.apiKey = randomString({ length: 20 }); + apiKey.apiKey = randomString({ length: 32 }); const result = await prisma.apiKeys.create({ data: { ...apiKey, diff --git a/src/_staart/rest/user.ts b/src/_staart/rest/user.ts index dd110293f..16bde48a7 100644 --- a/src/_staart/rest/user.ts +++ b/src/_staart/rest/user.ts @@ -490,7 +490,7 @@ export const createAccessTokenForUser = async ( ) throw new Error(INSUFFICIENT_PERMISSION); - accessToken.accessToken = randomString({ length: 20 }); + accessToken.accessToken = randomString({ length: 32 }); return prisma.accessTokens.create({ data: { ...accessToken, user: { connect: { id: userId } } }, });