#944: Fixed auth. sessions not persistent (#992)

This commit is contained in:
David Simpson
2022-05-23 09:52:44 +02:00
committed by GitHub
parent b407d0aee0
commit b8c718ce9e
3 changed files with 13 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ export class AuthenticationServiceImpl
protected readonly delegate = new ArduinoAuthenticationProvider();
protected readonly clients: AuthenticationServiceClient[] = [];
protected readonly toDispose = new DisposableCollection();
private initialized = false;
async onStart(): Promise<void> {
this.toDispose.pushAll([
@@ -42,7 +44,13 @@ export class AuthenticationServiceImpl
this.clients.forEach((client) => this.disposeClient(client))
),
]);
await this.delegate.init();
}
async initAuthSession(): Promise<void> {
if (!this.initialized) {
await this.delegate.init();
this.initialized = true
}
}
setOptions(authOptions: AuthOptions) {