Skip to content

Commit 0a4c5f8

Browse files
committed
Promisify randbytes
1 parent 95186b7 commit 0a4c5f8

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@fails-components/notepadhandler",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "Supplies server side notepad handling",
55
"author": "Marten Richter",
66
"license": "AGPL-3.0-or-later",

src/notepadhandler.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,10 @@ export class NoteScreenConnection {
817817
const client = this.redis
818818
const set = promisify(this.redis.set).bind(client)
819819
// ok first thing, we have to create a salt and set it in redis!
820-
const pollsalt = randomBytes(16).toString('base64') // the salt is absolutely confidential, everyone who knows it can spoil secrecy of polling!
820+
const randBytes = promisify(randomBytes)
821+
821822
try {
823+
const pollsalt = (await randBytes(16)).toString('base64') // the salt is absolutely confidential, everyone who knows it can spoil secrecy of polling!
822824
set(
823825
'pollsalt:lecture:' + lectureuuid + ':poll:' + poll.id,
824826
pollsalt,

0 commit comments

Comments
 (0)