Skip to content

Commit

Permalink
Merge pull request #99 from Esri/oauth-no-popup
Browse files Browse the repository at this point in the history
fix(oauth): check for window parent correctly in oauth without popup
  • Loading branch information
jgravois authored Jan 12, 2018
2 parents ae59cd9 + a27bb7d commit 94edc2a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/arcgis-rest-auth/src/UserSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export class UserSession implements IAuthenticationManager {
return undefined;
}

if (win.parent) {
if (win !== win.parent) {
win.parent[`__ESRI_REST_AUTH_HANDLER_${clientId}`](error, oauthInfo);
win.close();
return undefined;
Expand Down
6 changes: 6 additions & 0 deletions packages/arcgis-rest-auth/test/UserSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@ describe("UserSession", () => {
location: {
href:
"https://example-app.com/redirect-uri#access_token=token&expires_in=1209600&username=casey"
},
get parent() {
return this;
}
};

Expand Down Expand Up @@ -566,6 +569,9 @@ describe("UserSession", () => {
location: {
href:
"https://example-app.com/redirect-uri#error=Invalid_Signin&error_description=Invalid_Signin"
},
get parent() {
return this;
}
};

Expand Down

0 comments on commit 94edc2a

Please sign in to comment.