Fix regression in the check session service #1440
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this commit: 5c57084900237245e0fe3b7db58cc188f4f5fe75 the code was refactored in order to retrieve the reference to the browser's global variables via Angular's dependency injection.
In this line: 5c57084#diff-dec315070d26d82195b08309ea5550cfd8d36e230b58ab9ddb59a401fe9ff3a4L185,
window
was replaced withthis.document
which is wrong because the events of typemessage
are being emitted bywindow
, notdocument
.That prevents the library from receiving response
message
events from theiframe
, which causes these errors in the console:It also very probably prevents the check session mechanism from working at all.
My pull request fixes this by replacing
this.document
withthis.document.defaultView
, an actual reference towindow
.It fixes #1428