@logto/js 0.1.10 → 0.1.11

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verifyAndParseCodeFromCallbackUri = exports.parseUriParameters = void 0;
4
+ const essentials_1 = require("@silverhand/essentials");
4
5
  const consts_1 = require("../consts");
5
6
  const errors_1 = require("./errors");
6
7
  const parseUriParameters = (uri) => {
@@ -14,13 +15,10 @@ const verifyAndParseCodeFromCallbackUri = (callbackUri, redirectUri, state) => {
14
15
  throw new errors_1.LogtoError('callback_uri_verification.redirect_uri_mismatched');
15
16
  }
16
17
  const uriParameters = (0, exports.parseUriParameters)(callbackUri);
17
- const error = uriParameters.get(consts_1.QueryKey.Error);
18
- const errorDescription = uriParameters.get(consts_1.QueryKey.ErrorDescription);
18
+ const error = (0, essentials_1.conditional)(uriParameters.get(consts_1.QueryKey.Error));
19
+ const errorDescription = (0, essentials_1.conditional)(uriParameters.get(consts_1.QueryKey.ErrorDescription));
19
20
  if (error) {
20
- throw new errors_1.LogtoError('callback_uri_verification.error_found', {
21
- error,
22
- errorDescription,
23
- });
21
+ throw new errors_1.LogtoError('callback_uri_verification.error_found', new errors_1.OidcError(error, errorDescription));
24
22
  }
25
23
  const stateFromCallbackUri = uriParameters.get(consts_1.QueryKey.State);
26
24
  if (!stateFromCallbackUri) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/js",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "main": "./lib/index.js",
5
5
  "exports": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "ea6c7b435be8f74baf7fb76336bc0ca7cb7304c4"
61
+ "gitHead": "fb6df238f56049607af2c3b88bee07ba2aa45dae"
62
62
  }