mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-09 18:38:33 +00:00
Follow up 944: authentication sessions are not persistent (#1003)
* #944: Fixed auth. sessions not persistent * 944: Prevent race conditions setting authOptions * typo correction, duplicate identifier * prevent block of auth client service on setOptions * consider windows cred. mgr. password len limit
This commit is contained in:
@@ -43,15 +43,14 @@ export class AuthenticationClientService
|
||||
|
||||
readonly onSessionDidChange = this.onSessionDidChangeEmitter.event;
|
||||
|
||||
onStart(): void {
|
||||
async onStart(): Promise<void> {
|
||||
this.toDispose.push(this.onSessionDidChangeEmitter);
|
||||
this.service.setClient(this);
|
||||
this.service
|
||||
.session()
|
||||
.then((session) => this.notifySessionDidChange(session));
|
||||
|
||||
this.setOptions();
|
||||
this.service.initAuthSession()
|
||||
this.setOptions().then(() => this.service.initAuthSession());
|
||||
|
||||
this.arduinoPreferences.onPreferenceChanged((event) => {
|
||||
if (event.preferenceName.startsWith('arduino.auth.')) {
|
||||
@@ -60,8 +59,8 @@ export class AuthenticationClientService
|
||||
});
|
||||
}
|
||||
|
||||
setOptions(): void {
|
||||
this.service.setOptions({
|
||||
setOptions(): Promise<void> {
|
||||
return this.service.setOptions({
|
||||
redirectUri: `http://localhost:${serverPort}/callback`,
|
||||
responseType: 'code',
|
||||
clientID: this.arduinoPreferences['arduino.auth.clientID'],
|
||||
|
||||
Reference in New Issue
Block a user