mirror of
https://github.com/ssyyhhrr/stewardle.git
synced 2025-11-08 10:33:46 -05:00
Winner Authorization
This commit is contained in:
1
app.js
1
app.js
@@ -160,6 +160,7 @@ function server() {
|
||||
})
|
||||
|
||||
app.get("/winner", (req, res) => {
|
||||
if (req.headers.authorization != "Bearer kRyX3RYMRY$&yEc8") return res.end()
|
||||
res.json({
|
||||
"winner": drivers[driver].firstName + " " + drivers[driver].lastName
|
||||
})
|
||||
|
||||
@@ -238,7 +238,11 @@ async function submit(guess, real) {
|
||||
categories.forEach((category, index) => {
|
||||
document.getElementById(category).innerText = stats[index]
|
||||
})
|
||||
let data = await fetch(`${window.location.href}winner`)
|
||||
let data = await fetch(`${window.location.href}winner`, {
|
||||
headers: new Headers({
|
||||
"Authorization": "Bearer kRyX3RYMRY$&yEc8"
|
||||
})
|
||||
})
|
||||
let winner = await data.json()
|
||||
let gg = document.getElementsByClassName("input")[0]
|
||||
if (gg != null) {
|
||||
|
||||
Reference in New Issue
Block a user