@logto/browser 0.1.10 → 0.1.16

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.
Files changed (2) hide show
  1. package/lib/index.js +5 -3
  2. package/package.json +4 -5
package/lib/index.js CHANGED
@@ -35,7 +35,10 @@ class LogtoClient {
35
35
  this.getJwtVerifyGetKey = (0, lodash_once_1.default)(this._getJwtVerifyGetKey);
36
36
  this.accessTokenMap = new Map();
37
37
  this.getAccessTokenPromiseMap = new Map();
38
- this.logtoConfig = logtoConfig;
38
+ this.logtoConfig = {
39
+ ...logtoConfig,
40
+ scopes: (0, js_1.withReservedScopes)(logtoConfig.scopes).split(' '),
41
+ };
39
42
  this.logtoStorageKey = (0, utils_1.buildLogtoKey)(logtoConfig.appId);
40
43
  this.requester = requester;
41
44
  this._idToken = localStorage.getItem((0, utils_1.buildIdTokenKey)(this.logtoStorageKey));
@@ -136,12 +139,11 @@ class LogtoClient {
136
139
  return (0, js_1.fetchUserInfo)(userinfoEndpoint, accessToken, this.requester);
137
140
  }
138
141
  async signIn(redirectUri) {
139
- const { appId: clientId, resources, scopes: customScopes } = this.logtoConfig;
142
+ const { appId: clientId, resources, scopes } = this.logtoConfig;
140
143
  const { authorizationEndpoint } = await this.getOidcConfig();
141
144
  const codeVerifier = (0, js_1.generateCodeVerifier)();
142
145
  const codeChallenge = await (0, js_1.generateCodeChallenge)(codeVerifier);
143
146
  const state = (0, js_1.generateState)();
144
- const scopes = (0, js_1.withReservedScopes)(customScopes).split(' ');
145
147
  const signInUri = (0, js_1.generateSignInUri)({
146
148
  authorizationEndpoint,
147
149
  clientId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/browser",
3
- "version": "0.1.10",
3
+ "version": "0.1.16",
4
4
  "main": "./lib/index.js",
5
5
  "exports": "./lib/index.js",
6
6
  "typings": "./lib/index.d.ts",
@@ -15,7 +15,6 @@
15
15
  },
16
16
  "scripts": {
17
17
  "dev:tsc": "tsc -p tsconfig.build.json -w --preserveWatchOutput",
18
- "preinstall": "npx only-allow pnpm",
19
18
  "precommit": "lint-staged",
20
19
  "build": "rm -rf lib/ && tsc -p tsconfig.build.json",
21
20
  "lint": "eslint --ext .ts src",
@@ -24,7 +23,7 @@
24
23
  "prepack": "pnpm test"
25
24
  },
26
25
  "dependencies": {
27
- "@logto/js": "^0.1.10",
26
+ "@logto/js": "^0.1.16",
28
27
  "@silverhand/essentials": "^1.1.6",
29
28
  "jose": "^4.5.0",
30
29
  "lodash.get": "^4.4.2",
@@ -42,7 +41,7 @@
42
41
  "jest": "^27.5.1",
43
42
  "jest-location-mock": "^1.0.9",
44
43
  "jest-matcher-specific-error": "^1.0.0",
45
- "lint-staged": "^12.3.3",
44
+ "lint-staged": "^13.0.0",
46
45
  "prettier": "^2.3.2",
47
46
  "text-encoder": "^0.0.4",
48
47
  "ts-jest": "^27.0.4",
@@ -55,5 +54,5 @@
55
54
  "publishConfig": {
56
55
  "access": "public"
57
56
  },
58
- "gitHead": "ea6c7b435be8f74baf7fb76336bc0ca7cb7304c4"
57
+ "gitHead": "b56e794cea7ba791c73cd2da6e4ea405223d6970"
59
58
  }