fixed user not adding to localStorage

This commit is contained in:
Yue Fung Lee
2023-11-25 19:16:49 -05:00
parent 699fc6229b
commit 20c8b2b0fa
+1 -3
View File
@@ -9,13 +9,11 @@ export function signup(username: string, password: string)
db.users = JSON.stringify({})
const users = JSON.parse(db.users)
if (users[username])
throw new Error('Username already exists')
throw new Error('User already exists')
users[username] = password
db.users = JSON.stringify(users)
}
export function login(username: string, password: string)