mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-17 13:22:49 +01:00
auth.js: fix auth that let's everyone in
Even with authorized_keys being set, If noscraper is enabled in config, Then an unexpected behavior will occurs due to bad code on auth.js. See the following diff for details. Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
8b131e239b
commit
49181f4ec9
4
auth.js
4
auth.js
@ -18,7 +18,9 @@ module.exports = (authKey, data, ws, req) => {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!authorized_keys?.includes(data.pubkey) && !private_keys[data.pubkey] && !noscraper) {
|
||||
let pubkeyInConfig = authorized_keys?.includes(data.pubkey) || data.pubkey in private_keys;
|
||||
|
||||
if (authorized_keys?.length && !pubkeyInConfig) {
|
||||
ws.send(JSON.stringify(["OK", data.id, false, "unauthorized."]));
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user