Skip to content

Commit 85231bf

Browse files
committed
Adjusted login/register logic to allow complex passwords with special characters
1 parent 98e56a6 commit 85231bf

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/backend/db.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,9 @@ async function DoesAdminExist(username) {
420420

421421
async function RegisterUser(username, password, email) {
422422
username = SanitizeString(username);
423-
password = SanitizeString(password);
424423
email = SanitizeString(email);
425424

426-
if (username === null || password === null || email === null) {
425+
if (username === null || email === null) {
427426
return "Login Failed!";
428427
}
429428

@@ -455,9 +454,8 @@ async function RegisterUser(username, password, email) {
455454

456455
async function LoginUser(username, password) {
457456
username = SanitizeString(username);
458-
password = SanitizeString(password);
459457

460-
if (username === null || password === null) {
458+
if (username === null) {
461459
return "Username of Password Incorrect!";
462460
}
463461

@@ -502,9 +500,8 @@ async function LoginUser(username, password) {
502500

503501
async function LoginAdmin(username, password) {
504502
username = SanitizeString(username);
505-
password = SanitizeString(password);
506503

507-
if (username === null || password === null) {
504+
if (username === null) {
508505
console.log("Potentially Malformed Data!");
509506
return "Username of Password Incorrect!";
510507
}
@@ -1729,9 +1726,8 @@ async function DeleteChallenge(data, adminUsername) {
17291726

17301727
async function RegisterAdmin(username, password) {
17311728
username = SanitizeString(username);
1732-
password = SanitizeString(password);
17331729

1734-
if (username === null || password === null) {
1730+
if (username === null) {
17351731
return "Register Failed!";
17361732
}
17371733

0 commit comments

Comments
 (0)