From 70f071180c932e9cf5029b47ec5e0d1e2623b4b4 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 24 Dec 2024 15:05:33 -0500 Subject: Dashboard, fixed some issues with port --- README.md | 2 +- index.js | 8 ++++---- public/css/style.css | 36 +++++++++++++++++++++++++++++++++--- views/dashboard.ejs | 20 ++++++++++++++++++++ views/index.ejs | 5 +++-- views/login.ejs | 26 -------------------------- views/password.ejs | 26 ++++++++++++++++++++++++++ views/register.ejs | 1 + views/success.ejs | 2 +- 9 files changed, 89 insertions(+), 37 deletions(-) create mode 100644 views/dashboard.ejs delete mode 100644 views/login.ejs create mode 100644 views/password.ejs diff --git a/README.md b/README.md index 386f684..a092fcf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # bnbso-auth -Web authentication for bnbSO (registering accounts, resetting passwords, changing passwords) using Discord authentication. Programmed for FreeSO-based servers. +Web authentication for bnbSO (registering accounts, resetting passwords, changing passwords) using Discord authentication. Designed for FreeSO-based servers. To install dependencies: diff --git a/index.js b/index.js index c109ab2..f82209b 100644 --- a/index.js +++ b/index.js @@ -62,13 +62,13 @@ app.use(passport.session()); // Routes app.get("/", async (req, res) => { if (req.isAuthenticated()) { - const { id, username, email, guilds } = req.user; + const { id, guilds } = req.user; const isInGuild = guilds.some((guild) => guild.id === process.env.GUILD_ID); if (isInGuild) { - let userExists = true; + let userExists = false; if (userExists) { - return res.render('login'); + return res.render('dashboard', req.user); } else { return res.render('register', req.user); } @@ -137,4 +137,4 @@ app.get("/logout", (req, res) => { }); const port = 3000; -app.listen(PORT, () => console.log(`Server running on http://localhost:${port}`)); +app.listen(port, () => console.log(`Server running on http://localhost:${port}`)); diff --git a/public/css/style.css b/public/css/style.css index 31d3530..a6c3ea8 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -30,11 +30,11 @@ a:active { color: #2773ff; } -.discord { +.button { display: inline-block; text-decoration: none; color: #fff; - background-color: #5865F2; + background-color: #00633a; padding: 10px 20px; border-radius: 5px; transition: 0.2s; @@ -42,6 +42,36 @@ a:active { } +.button:hover { + background-color: #009959; + color: #fff; +} + +.button:active { + background-color: #003620; + color: #fff; +} + +.logout { + background-color: #630000; + +} + +.logout:hover { + background-color: #990000; +} + +.logout:active { + background-color: #360000; +} + + + +.discord { + background-color: #5865F2; + +} + .discord:hover { background-color: #727dee; } @@ -107,6 +137,6 @@ button { } .error { - color: rgb(248, 140, 140); + color: #f88c8c; font-size: 1.5em; } \ No newline at end of file diff --git a/views/dashboard.ejs b/views/dashboard.ejs new file mode 100644 index 0000000..b50f0e0 --- /dev/null +++ b/views/dashboard.ejs @@ -0,0 +1,20 @@ + + + + + + + bnbSO Dashboard + + +
+
+ logo +

Welcome, <%= username %>!

+

FreeSO Username:

+ Change Password + Download bnbSO Client + Logout +
+ + \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index d46a61a..dc893d4 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -10,8 +10,9 @@
logo -

You must be a member of the bits & Bytes Discord server to join bnbSO.

- Login with Discord +

Log into your Discord account to get access to bnbSO.

+

You must be a bits & Bytes member to join.

+ Login with Discord
\ No newline at end of file diff --git a/views/login.ejs b/views/login.ejs deleted file mode 100644 index a5a51ae..0000000 --- a/views/login.ejs +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - bnbSO Login - - -
-
- logo -

Login

-
- - - - - -
- Forgot Password - <% if (typeof error !== 'undefined') { %> -
<%= error %>
- <% } %> - - \ No newline at end of file diff --git a/views/password.ejs b/views/password.ejs new file mode 100644 index 0000000..2e24399 --- /dev/null +++ b/views/password.ejs @@ -0,0 +1,26 @@ + + + + + + + bnbSO Login + + +
+
+ logo +

Login

+
+ + + + + +
+ Forgot Password + <% if (typeof error !== 'undefined') { %> +
<%= error %>
+ <% } %> + + \ No newline at end of file diff --git a/views/register.ejs b/views/register.ejs index fcff088..66058c3 100644 --- a/views/register.ejs +++ b/views/register.ejs @@ -13,6 +13,7 @@

Welcome to bnbSO!

You will be sending the following information to register your bnbSO account

Please verify that the following information is correct. You can only change this once.

+

Note: You can change your username and email if you want to change it.
It is there as your Discord account are using these credentials.

diff --git a/views/success.ejs b/views/success.ejs index c967d24..224b260 100644 --- a/views/success.ejs +++ b/views/success.ejs @@ -12,7 +12,7 @@ logo

Created account successfully!

Check on your inbox for the confirmation code.

- Home + Dashboard
\ No newline at end of file -- cgit v1.2.3