From 2cba36d879171146d473c0ade037ab87751b443e Mon Sep 17 00:00:00 2001 From: Kacper Michalik Date: Fri, 27 Oct 2023 10:07:54 +0200 Subject: [PATCH] fix: generating secret --- packages/common/src/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/src/auth.ts b/packages/common/src/auth.ts index 7dd2dc23b1..92e510877d 100644 --- a/packages/common/src/auth.ts +++ b/packages/common/src/auth.ts @@ -1,9 +1,9 @@ import { Crypto } from '@peculiar/webcrypto' const webcrypto = new Crypto() -const array = new Uint32Array(10) +const array = new Uint32Array(5) -export const generateSecret = () => webcrypto.getRandomValues(array).toString() +export const generateSecret = () => webcrypto.getRandomValues(array).join('') export const encodeSecret = (secret: string) => Buffer.from(secret).toString('base64')