Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
register
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasEbbinghaus25 committed Jun 12, 2024
1 parent 44775c5 commit 01a906b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/web/src/services/AuthService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> => {
Expand Down

0 comments on commit 01a906b

Please sign in to comment.