Skip to content

Commit

Permalink
fix: generating secret
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacper-RF committed Oct 27, 2023
1 parent 47199f5 commit 2cba36d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/common/src/auth.ts
Original file line number Diff line number Diff line change
@@ -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')

Expand Down

0 comments on commit 2cba36d

Please sign in to comment.