Skip to content

Commit

Permalink
Distinguish authorizeTimeout from just timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehobbsdev committed Feb 10, 2022
1 parent a9d767c commit 130a6b8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Auth0Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1078,9 +1078,6 @@ export default class Auth0Client {
response_mode: 'web_message'
});

const timeout =
options.timeoutInSeconds || this.options.authorizeTimeoutInSeconds;

try {
// When a browser is running in a Cross-Origin Isolated context, using iframes is not possible.
// It doesn't throw an error but times out instead, so we should exit early and inform the user about the reason.
Expand All @@ -1092,7 +1089,10 @@ export default class Auth0Client {
);
}

const codeResult = await runIframe(url, this.domainUrl, timeout);
const authorizeTimeout =
options.timeoutInSeconds || this.options.authorizeTimeoutInSeconds;

const codeResult = await runIframe(url, this.domainUrl, authorizeTimeout);

if (stateIn !== codeResult.state) {
throw new Error('Invalid state');
Expand Down

0 comments on commit 130a6b8

Please sign in to comment.