mirror of
https://github.com/Alee14/bnbso-auth.git
synced 2025-01-22 10:41:57 -05:00
Changed discord usernames to id as they are permanent unlike username which can be changed
This commit is contained in:
parent
12669097d8
commit
39cbc8c286
3 changed files with 3 additions and 4 deletions
BIN
bun.lockb
BIN
bun.lockb
Binary file not shown.
4
index.js
4
index.js
|
@ -95,7 +95,7 @@ app.get("/", async (req, res) => {
|
||||||
|
|
||||||
app.post("/register", upload.none(), async (req, res) => {
|
app.post("/register", upload.none(), async (req, res) => {
|
||||||
if (req.isAuthenticated()) {
|
if (req.isAuthenticated()) {
|
||||||
const { username: discordUsername, id } = req.user;
|
const { id } = req.user;
|
||||||
const { username, password, passwordconfirm } = req.body;
|
const { username, password, passwordconfirm } = req.body;
|
||||||
|
|
||||||
if (password !== passwordconfirm) {
|
if (password !== passwordconfirm) {
|
||||||
|
@ -105,7 +105,7 @@ app.post("/register", upload.none(), async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
form.append('username', username);
|
form.append('username', username);
|
||||||
form.append('email', discordUsername + '@discord.com');
|
form.append('email', id + '@discord.com');
|
||||||
form.append('password', password);
|
form.append('password', password);
|
||||||
form.append('key', process.env.REG_KEY);
|
form.append('key', process.env.REG_KEY);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest"
|
||||||
"tailwindcss": "^3.4.17"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5.0.0"
|
"typescript": "^5.0.0"
|
||||||
|
|
Loading…
Reference in a new issue