Skip to content

Commit fd8ea62

Browse files
Limit scope of the sample to the simple solution
For more robust solutions when you need it, turn to the linked issue on GitHub. This sample will do well enough in most cases with the default code. So we'll close the related issue too. Fixes #2
1 parent ba0a17a commit fd8ea62

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/app/core/auth.service.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,13 @@ export class AuthService {
4848
}
4949
});
5050

51-
// This is tricky, as it might cause race conditions (where access_token is set in another
52-
// tab before everything is said and done there.
53-
// TODO: Improve this setup. See: https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/issues/2
51+
// THe following cross-tab communication of fresh access tokens works usually in practice,
52+
// but if you need more robust handling the community has come up with ways to extend logic
53+
// in the library which may give you better mileage.
54+
//
55+
// See: https://github.com/jeroenheijmans/sample-angular-oauth2-oidc-with-auth-guards/issues/2
56+
//
57+
// Until then we'll stick to this:
5458
window.addEventListener('storage', (event) => {
5559
// The `key` is `null` if the event was caused by `.clear()`
5660
if (event.key !== 'access_token' && event.key !== null) {

0 commit comments

Comments
 (0)