rewrote the authorisation flow: give more responsability to gameManager and less to gameScene
This commit is contained in:
parent
032facb75f
commit
02c193a262
14 changed files with 244 additions and 170 deletions
16
front/src/Connexion/LocalUserStore.ts
Normal file
16
front/src/Connexion/LocalUserStore.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
import {LocalUser} from "./LocalUser";
|
||||
|
||||
class LocalUserStore {
|
||||
|
||||
saveUser(localUser: LocalUser) {
|
||||
localStorage.setItem('localUser', JSON.stringify(localUser));
|
||||
}
|
||||
|
||||
getLocalUser(): LocalUser|null {
|
||||
const data = localStorage.getItem('localUser');
|
||||
return data ? JSON.parse(data) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const localUserStore = new LocalUserStore();
|
Loading…
Add table
Add a link
Reference in a new issue