mirror of
https://api.glitch.com/git/presence-button
synced 2024-12-05 02:07:29 +00:00
👡🍟 Checkpoint
./server.js:933874/15281
This commit is contained in:
parent
2f679e086b
commit
54536d3edd
@ -47,7 +47,8 @@ app.get("/status", (req, res) => {
|
||||
|
||||
// parse login and password from headers
|
||||
const b64auth = (req.headers.authorization || "").split(" ")[1] || "";
|
||||
const [_, login, password] = new Buffer(b64auth, 'base64').toString().match(/(.*):(.*)/) || []; // slightly modified as we use : in username
|
||||
const [_, login, password] =
|
||||
new Buffer(b64auth, "base64").toString().match(/(.*):(.*)/) || []; // slightly modified as we use : in username
|
||||
|
||||
if (
|
||||
!login ||
|
||||
@ -55,7 +56,7 @@ app.get("/status", (req, res) => {
|
||||
login !== auth.login ||
|
||||
password !== auth.password
|
||||
) {
|
||||
console.log(login, password)
|
||||
console.log(login, password);
|
||||
res.set("WWW-Authenticate", 'Basic realm="Authentication required"');
|
||||
return res.status(401).send("Authentication required.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user