From 01a906be4bf137103abc3d2921d94dce69f76b5d Mon Sep 17 00:00:00 2001 From: JonasEbbinghaus25 Date: Wed, 12 Jun 2024 20:03:55 +0200 Subject: [PATCH] register --- src/main/web/src/services/AuthService.tsx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/web/src/services/AuthService.tsx b/src/main/web/src/services/AuthService.tsx index 4ff6fccc..697b8da8 100644 --- a/src/main/web/src/services/AuthService.tsx +++ b/src/main/web/src/services/AuthService.tsx @@ -16,14 +16,10 @@ export const register = async (username: string, email: string, password: string }; export const saveUserDataToLocalStorage = (data: { accountId: number; userId: number; username: string; accessToken: string; }): void => { - if (data.accountId !== undefined && data.userId !== undefined && data.username && data.accessToken) { - localStorage.setItem('accountId', data.accountId.toString()); - localStorage.setItem('userId', data.userId.toString()); - localStorage.setItem('username', data.username); - localStorage.setItem('token', data.accessToken); - } else { - console.error('Invalid user data:', data); - } + localStorage.setItem('accountId', "" + data.accountId.toString()); + localStorage.setItem('userId', data.userId.toString()); + localStorage.setItem('username', data.username); + localStorage.setItem('token', data.accessToken); }; export const login = async (username: string, password: string, rememberMe: boolean): Promise => {