Skip to content

Commit

Permalink
update(Auth0Client):added cookieDomain to _processOrgIdHint (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dannnir authored May 6, 2022
1 parent 0ae6078 commit 36b1cd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions __tests__/Auth0Client/loginWithPopup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ describe('Auth0Client', () => {
});

it('saves organization hint cookie in storage', async () => {
const auth0 = setup({}, { org_id: TEST_ORG_ID });
const auth0 = setup({ cookieDomain: TEST_DOMAIN }, { org_id: TEST_ORG_ID });

await loginWithPopup(auth0);

Expand All @@ -685,7 +685,8 @@ describe('Auth0Client', () => {
`auth0.${TEST_CLIENT_ID}.organization_hint`,
JSON.stringify(TEST_ORG_ID),
{
expires: 1
expires: 1,
domain: TEST_DOMAIN
}
);
});
Expand Down
3 changes: 2 additions & 1 deletion src/Auth0Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,8 @@ export default class Auth0Client {
private _processOrgIdHint(organizationId?: string) {
if (organizationId) {
this.cookieStorage.save(this.orgHintCookieName, organizationId, {
daysUntilExpire: this.sessionCheckExpiryDays
daysUntilExpire: this.sessionCheckExpiryDays,
cookieDomain: this.options.cookieDomain
});
} else {
this.cookieStorage.remove(this.orgHintCookieName);
Expand Down

0 comments on commit 36b1cd2

Please sign in to comment.