Skip to content

Commit

Permalink
feat(frontend): Show "Incorrect password" if the password is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
ravenclaw900 committed Dec 30, 2021
1 parent 95d07b2 commit 02c540e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file modified src/frontend/.yarn/install-state.gz
Binary file not shown.
11 changes: 10 additions & 1 deletion src/frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
let node = `${window.location.hostname}:${window.location.port}`;
let notificationsShown = false;
let settingsShown = false;
let passwordMessage = false;
// Get dark mode
if (localStorage.getItem("darkMode") != null) {
Expand Down Expand Up @@ -189,7 +190,10 @@
(response) =>
response.text().then((body) => {
password = "";
if (body != "Unauthorized") {
if (body == "Unauthorized") {
passwordMessage = true;
setTimeout(() => (passwordMessage = false), 2000);
} else {
(token = body),
localStorage.setItem("token", body),
(loginDialog = false),
Expand Down Expand Up @@ -251,6 +255,11 @@
class="border-gray-500 hover:bg-gray-100 dark:hover:bg-gray-900 focus:outline-none border p-2 rounded active:bg-gray-200 dark:active:bg-gray-800"
>Login</button
>
{#if passwordMessage}
<h6 class="text-red-500" transition:fade>
Incorrect password
</h6>
{/if}
</div>
</div>
{/if}
Expand Down

0 comments on commit 02c540e

Please sign in to comment.