@auth0/auth0-spa-js 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auth0-spa-js.development.js +12 -5
- package/dist/auth0-spa-js.development.js.map +1 -1
- package/dist/auth0-spa-js.production.esm.js +1 -1
- package/dist/auth0-spa-js.production.esm.js.map +1 -1
- package/dist/auth0-spa-js.production.js +1 -1
- package/dist/auth0-spa-js.production.js.map +1 -1
- package/dist/lib/auth0-spa-js.cjs.js +13 -5
- package/dist/lib/auth0-spa-js.cjs.js.map +1 -1
- package/dist/typings/Auth0Client.d.ts +12 -1
- package/dist/typings/constants.d.ts +6 -0
- package/dist/typings/index.d.ts +1 -1
- package/dist/typings/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Auth0Client.ts +36 -6
- package/src/constants.ts +7 -0
- package/src/index.ts +1 -1
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -30,7 +30,7 @@ npm install @auth0/auth0-spa-js
|
|
|
30
30
|
From the CDN:
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
|
-
<script src="https://cdn.auth0.com/js/auth0-spa-js/2.
|
|
33
|
+
<script src="https://cdn.auth0.com/js/auth0-spa-js/2.17/auth0-spa-js.production.js"></script>
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
### Configure Auth0
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
var e = new Error(message);
|
|
16
16
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
17
17
|
};
|
|
18
|
-
var version = "2.
|
|
18
|
+
var version = "2.17.0";
|
|
19
19
|
const DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS = 60;
|
|
20
20
|
const DEFAULT_POPUP_CONFIG_OPTIONS = {
|
|
21
21
|
timeoutInSeconds: DEFAULT_AUTHORIZE_TIMEOUT_IN_SECONDS
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
const MISSING_REFRESH_TOKEN_ERROR_MESSAGE = "Missing Refresh Token";
|
|
28
28
|
const INVALID_REFRESH_TOKEN_ERROR_MESSAGE = "invalid refresh token";
|
|
29
29
|
const USER_BLOCKED_ERROR_MESSAGE = "user is blocked";
|
|
30
|
+
const MFA_STEP_UP_ERROR_DESCRIPTION = "Multifactor authentication required";
|
|
30
31
|
const DEFAULT_SCOPE = "openid profile email";
|
|
31
32
|
const DEFAULT_SESSION_CHECK_EXPIRY_DAYS = 1;
|
|
32
33
|
const DEFAULT_AUTH0_CLIENT = {
|
|
@@ -7747,7 +7748,10 @@
|
|
|
7747
7748
|
}
|
|
7748
7749
|
}
|
|
7749
7750
|
_isInteractiveError(error) {
|
|
7750
|
-
return error instanceof MfaRequiredError;
|
|
7751
|
+
return error instanceof MfaRequiredError || error instanceof GenericError && this._isIframeMfaError(error);
|
|
7752
|
+
}
|
|
7753
|
+
_isIframeMfaError(error) {
|
|
7754
|
+
return error.error === "login_required" && error.error_description === MFA_STEP_UP_ERROR_DESCRIPTION;
|
|
7751
7755
|
}
|
|
7752
7756
|
async _handleInteractiveErrorWithPopup(options) {
|
|
7753
7757
|
try {
|
|
@@ -7872,9 +7876,12 @@
|
|
|
7872
7876
|
}));
|
|
7873
7877
|
} catch (e) {
|
|
7874
7878
|
if (e.error === "login_required") {
|
|
7875
|
-
this.
|
|
7876
|
-
|
|
7877
|
-
|
|
7879
|
+
const shouldSkipLogoutForMfaStepUp = e instanceof GenericError && this._isIframeMfaError(e) && this.options.interactiveErrorHandler === "popup";
|
|
7880
|
+
if (!shouldSkipLogoutForMfaStepUp) {
|
|
7881
|
+
this.logout({
|
|
7882
|
+
openUrl: false
|
|
7883
|
+
});
|
|
7884
|
+
}
|
|
7878
7885
|
}
|
|
7879
7886
|
throw e;
|
|
7880
7887
|
}
|