chore: clean up FSM code

This commit is contained in:
Paul Makles
2022-06-29 10:28:24 +01:00
parent c142c2e74d
commit 68c8ca50f3
6 changed files with 44 additions and 20 deletions

View File

@@ -8,6 +8,7 @@ import Store from "../interfaces/Store";
interface Account {
session: Session;
apiUrl?: string;
}
export interface Data {
@@ -70,9 +71,10 @@ export default class Auth implements Store, Persistent<Data> {
/**
* Add a new session to the auth manager.
* @param session Session
* @param apiUrl Custom API URL
*/
@action setSession(session: Session) {
this.sessions.set(session.user_id, { session });
@action setSession(session: Session, apiUrl?: string) {
this.sessions.set(session.user_id, { session, apiUrl });
}
/**