committed by
Kyle Carberry
parent
7cc7aa51aa
commit
0efae1fcb6
@@ -28,3 +28,14 @@ submit.addEventListener("click", () => {
|
||||
document.cookie = `password=${password.value}`;
|
||||
location.reload();
|
||||
});
|
||||
|
||||
/**
|
||||
* Notify user on load of page if previous password was unsuccessful
|
||||
*/
|
||||
const reg = new RegExp(`password=(\\w+);?`);
|
||||
const matches = document.cookie.match(reg);
|
||||
const errorDisplay = document.getElementById("error-display") as HTMLDivElement;
|
||||
|
||||
if (document.referrer === document.location.href && matches) {
|
||||
errorDisplay.innerText = "Password is incorrect!";
|
||||
}
|
||||
Reference in New Issue
Block a user