diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-06-27 16:40:40 +1000 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2022-06-27 16:40:40 +1000 |
commit | 845d932e83b65b1807029e9a1408da1b73baf355 (patch) | |
tree | 0cd5645beb77e8f598986d07d9248952c645f976 /slowcord | |
parent | removed build dir (diff) | |
download | server-845d932e83b65b1807029e9a1408da1b73baf355.tar.xz |
( bad ) lil error message on failed login
Diffstat (limited to 'slowcord')
-rw-r--r-- | slowcord/public/login.html | 15 | ||||
-rw-r--r-- | slowcord/src/index.ts | 3 |
2 files changed, 15 insertions, 3 deletions
diff --git a/slowcord/public/login.html b/slowcord/public/login.html index 2325f396..e53dfde9 100644 --- a/slowcord/public/login.html +++ b/slowcord/public/login.html @@ -89,6 +89,13 @@ #loginDiscord { background-color: var(--background-login-discord); } + + #failure { + width: 100%; + margin-top: 10px; + color: rgb(200, 20, 20); + display: none; + } </style> </head> @@ -98,8 +105,11 @@ <div class="header"> <h1>Welcome to Slowcord</h1> <p>Glad to see you <3 </p> + + <p id="failure">Login failed</p> </div> + <form action="javascript:void(0);"> <label for="email">Email</label> <input type="email" name="email" /> @@ -107,7 +117,7 @@ <label for="password">Password</label> <input type="password" name="password" /> - <input type="submit" /> + <input type="submit" value="Login" /> <a id="loginDiscord" @@ -157,7 +167,10 @@ if (json.token) { window.localStorage.setItem("token", `"${json.token}"`); window.location.href = "/app"; + return; } + + document.getElementById("failure").style.display = "block"; }) </script> </body> diff --git a/slowcord/src/index.ts b/slowcord/src/index.ts index e4ad3917..e22acaf3 100644 --- a/slowcord/src/index.ts +++ b/slowcord/src/index.ts @@ -71,9 +71,8 @@ const handlers: { [key: string]: any; } = { app.get("/oauth/:type", async (req, res) => { const { type } = req.params; - if (!type) return res.sendStatus(400); const handler = handlers[type]; - if (!handler) return res.sendStatus(400); + if (!type || !handler) return res.sendStatus(400); const data = await handler.getAccessToken(req, res); if (!data) return res.sendStatus(500); |