mirror of
https://github.com/Yonle/bostr.git
synced 2025-12-19 20:24:28 +01:00
auth: fix bug on using event validation
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
4
auth.js
4
auth.js
@@ -1,8 +1,8 @@
|
||||
const { verifyEvent } = require("nostr-tools");
|
||||
const { validateEvent, verifyEvent } = require("nostr-tools");
|
||||
const { authorized_keys, private_keys } = require("./config");
|
||||
|
||||
module.exports = (authKey, data, ws, req) => {
|
||||
if (!verifyEvent(data)) {
|
||||
if (!validateEvent(data) || !verifyEvent(data)) {
|
||||
ws.send(JSON.stringify(["NOTICE", "error: invalid challenge response."]));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user