Skip to content

The OAuthService doesn't clean up all used resources when it is destroyed #665

@Andreas-Hjortland

Description

@Andreas-Hjortland

Describe the bug
If you destroy the OAuthService, for instance through destroying the angular app, the attached event listeners and the sessionCheckTimer will still continue to run.

Stackblitz example
https://angular-abivfc.stackblitz.io/

To Reproduce
Steps to reproduce the behavior:

  1. Go to the stackblitz. You might need to change of fix the issuer configured in app.component.ts. I have used the one in the example code.
  2. Log in to the identity server and redirect back to the site
  3. Open the console
  4. See error "Cannot read proprety 'contentWindow' of null" or similar error on other browsers.

Expected behavior
All timers, events and elements that the OAuthService created should be stopped or removed when the angular app is destroyed and the framework calls ngOnDestroy.

Desktop (please complete the following information):

  • OS: Tested on windows 10, but will probably work the same on all platforms
  • Browser Tested in chrome 78 and Firefox 71

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugFor tagging faulty or unexpected behavior.investigation-neededIndication that the maintainer or involved community members may need to investigate more.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions