This commit is contained in:
Tracker-Friendly 2024-02-25 19:21:26 +00:00
parent f6a28d0ace
commit f3ac1aab10
2 changed files with 4 additions and 4 deletions

2
main
View File

@ -205,7 +205,7 @@ async def apilogin():
"key": randomCharacters, "key": randomCharacters,
}, 200 }, 200
if str(passwordchange) == "1": if str(passwordchange) == "yes":
hashedpassword = generate_password_hash(newpass) hashedpassword = generate_password_hash(newpass)
conn = get_db_connection() conn = get_db_connection()
conn.execute("UPDATE users SET password = ? WHERE username = ?", (hashedpassword, username)) conn.execute("UPDATE users SET password = ? WHERE username = ?", (hashedpassword, username))

View File

@ -111,8 +111,8 @@ signupButton.addEventListener("click", (event) => {
body: JSON.stringify({ body: JSON.stringify({
username: username, username: username,
password: await hashpass(password), password: await hashpass(password),
passwordchange: "0", passwordchange: "no",
newpass: 0 newpass: "null"
}), }),
headers: { headers: {
"Content-type": "application/json; charset=UTF-8" "Content-type": "application/json; charset=UTF-8"
@ -135,7 +135,7 @@ signupButton.addEventListener("click", (event) => {
body: JSON.stringify({ body: JSON.stringify({
username: username, username: username,
password: await hashpassold(password), password: await hashpassold(password),
passwordchange: "1", passwordchange: "yes",
newpass: await hashpass(password) newpass: await hashpass(password)
}), }),
headers: { headers: {