Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Client.logout #2661

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
31de5d4
fix: Client.logout removes session properly
alechkos Dec 2, 2023
0850117
fix: typo
alechkos Dec 1, 2023
6d68da4
fix: use 'disconnected' event
alechkos Dec 3, 2023
768dd6a
Merge branch 'main' into fix-logout
alechkos Dec 5, 2023
75dc847
feat: delete sesion folder once session terminated
alechkos Dec 6, 2023
8c6a133
Merge branch 'main' into fix-logout
alechkos Dec 7, 2023
a40fad9
Merge branch 'main' into fix-logout
alechkos Dec 12, 2023
d580703
Merge branch 'main' into fix-logout
alechkos Dec 12, 2023
d11bc8c
Merge branch 'main' into fix-logout
alechkos Dec 16, 2023
9b45e14
Merge branch 'main' into fix-logout
alechkos Dec 17, 2023
5fef377
Merge branch 'main' into fix-logout
alechkos Jan 2, 2024
48ae190
Merge branch 'main' into fix-logout
alechkos Jan 11, 2024
8134edf
Merge branch 'main' into fix-logout
alechkos Jan 11, 2024
abfee0b
Merge branch 'main' into fix-logout
alechkos Jan 14, 2024
18b03d9
Merge branch 'main' into fix-logout
alechkos Jan 18, 2024
278f8e3
Merge branch 'main' into fix-logout
alechkos Mar 1, 2024
d501120
Merge branch 'main' into fix-logout
alechkos Apr 3, 2024
e16b9f2
Merge branch 'main' into fix-logout
alechkos Apr 22, 2024
c63a12c
style: fix broken link in readme file
alechkos Apr 22, 2024
b29e616
Merge branch 'main' into fix-logout
alechkos Apr 27, 2024
108fe37
Merge branch 'main' into fix-logout
alechkos Apr 28, 2024
00ee60a
Merge branch 'main' into fix-logout
alechkos Apr 30, 2024
adff251
Merge branch 'main' into fix-logout
alechkos Apr 30, 2024
db1a703
Merge branch 'main' into fix-logout
alechkos May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/Client.js
Expand Up @@ -756,6 +756,7 @@ class Client extends EventEmitter {
await this.authStrategy.disconnect();
this.emit(Events.DISCONNECTED, 'NAVIGATION');
await this.destroy();
alechkos marked this conversation as resolved.
Show resolved Hide resolved
await this.authStrategy.logout();
}
});
}
Expand Down Expand Up @@ -804,15 +805,11 @@ class Client extends EventEmitter {
await this.pupPage.evaluate(() => {
return window.Store.AppState.logout();
});
await this.pupBrowser.close();

let maxDelay = 0;
while (this.pupBrowser.isConnected() && (maxDelay < 10)) { // waits a maximum of 1 second before calling the AuthStrategy
await new Promise(resolve => setTimeout(resolve, 100));
maxDelay++;
}

await this.authStrategy.logout();

this.pupBrowser.on('disconnected', async () => {
await this.pupBrowser.close();
await this.authStrategy.logout();
});
}

/**
Expand Down