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(oauth): check for window parent correctly in oauth without popup #99

Merged
merged 1 commit into from
Jan 12, 2018

Conversation

noahmulfinger
Copy link
Contributor

@noahmulfinger noahmulfinger commented Jan 4, 2018

window.parent is equal to itself when there is no parent (see https://developer.mozilla.org/en-US/docs/Web/API/Window/parent), so it will always be truthy. Need to check
that the window has a separate parent instead.

Currently, if you set popup to false when doing oauth through the UserSession, you'll get an error when calling completeOauth2 because it tries to run

win.parent[`__ESRI_REST_AUTH_HANDLER_${clientId}`](error, oauthInfo);

at UserSession:342

AFFECTS PACKAGES:
@esri/arcgis-rest-auth

window.parent is equal to itself when there is no parent, so it will always be truthy. Need to check
that the window has a separate parent instead.

AFFECTS PACKAGES:
@esri/arcgis-rest-auth
@coveralls
Copy link

coveralls commented Jan 4, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling a27bb7d on oauth-no-popup into ae59cd9 on master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a27bb7d on oauth-no-popup into ae59cd9 on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a27bb7d on oauth-no-popup into ae59cd9 on master.

Copy link
Contributor

@jgravois jgravois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed the fix manually. nice work!

@jgravois jgravois merged commit 94edc2a into master Jan 12, 2018
@jgravois jgravois deleted the oauth-no-popup branch January 12, 2018 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants