From 20c8b2b0faf9e8d5d0062e871ce5444140b67b57 Mon Sep 17 00:00:00 2001 From: Yue Fung Lee Date: Sat, 25 Nov 2023 19:16:49 -0500 Subject: [PATCH] fixed user not adding to localStorage --- frontend/src/logic/sdk.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/logic/sdk.ts b/frontend/src/logic/sdk.ts index 04e040b..5e82bbc 100644 --- a/frontend/src/logic/sdk.ts +++ b/frontend/src/logic/sdk.ts @@ -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)