aboutsummaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2024-12-24 17:34:23 -0500
committerAndrew Lee <andrew@alee14.me>2024-12-24 17:34:23 -0500
commit39cbc8c286227eca935248ad9237d66fa6f45f6e (patch)
treebc7eb63a91537b6a173a61282d8acce5206a1422 /index.js
parent12669097d86af780fdf4bec629aa81ba15b7c116 (diff)
downloadfreeso-discord-auth-39cbc8c286227eca935248ad9237d66fa6f45f6e.tar.gz
freeso-discord-auth-39cbc8c286227eca935248ad9237d66fa6f45f6e.tar.bz2
freeso-discord-auth-39cbc8c286227eca935248ad9237d66fa6f45f6e.zip
Changed discord usernames to id as they are permanent unlike username which can be changed
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.js b/index.js
index c06f88a..1e03b94 100644
--- a/index.js
+++ b/index.js
@@ -95,7 +95,7 @@ app.get("/", async (req, res) => {
app.post("/register", upload.none(), async (req, res) => {
if (req.isAuthenticated()) {
- const { username: discordUsername, id } = req.user;
+ const { id } = req.user;
const { username, password, passwordconfirm } = req.body;
if (password !== passwordconfirm) {
@@ -105,7 +105,7 @@ app.post("/register", upload.none(), async (req, res) => {
try {
const form = new FormData();
form.append('username', username);
- form.append('email', discordUsername + '@discord.com');
+ form.append('email', id + '@discord.com');
form.append('password', password);
form.append('key', process.env.REG_KEY);