Skip to content

Commit

Permalink
fix: params
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 committed Mar 28, 2024
1 parent f920c4d commit acb5aa8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/scripts/change.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ new_password.oninput = (e) => {
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());

if (!params.token)
if (!params.key)
document.location.replace("./login.html");

submit.addEventListener("click", (e) => {
Expand All @@ -67,7 +67,7 @@ submit.addEventListener("click", (e) => {
method : "POST",
headers : { "Content-Type": "application/json" },
body : JSON.stringify({
token : params.token,
key : params.key,
new_pass : new_password.value,
}),
})
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ submit.addEventListener("click", (e) => {
})
.then(async res => {
if (res.ok) {
window.location.href = `./user.html?token=${await res.text()}`;
window.location.href = `./user.html?key=${await res.text()}`;
} else {
switch (await res.text()) {
case "Invaild email!": {
Expand Down

0 comments on commit acb5aa8

Please sign in to comment.