Type-safe session instantiation

This commit is contained in:
Alexander Skvortsov 2021-12-12 15:39:06 -05:00
parent 4444e7c788
commit 306b3a9e8b
No known key found for this signature in database
GPG Key ID: C4E3BBF9C3412B4C

View File

@ -258,7 +258,7 @@ export default class Application {
this.forum = this.store.getById('forums', '1')!;
this.session = new Session(this.store.getById('users', String(this.data.session.userId)), this.data.session.csrfToken);
this.session = new Session(this.store.getById<User>('users', String(this.data.session.userId)) ?? null, this.data.session.csrfToken);
this.mount();