@logto/connector-google 1.0.0-beta.15 → 1.0.0-beta.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.
- package/README.md +2 -2
- package/lib/index.js +43 -25
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ Now you should have the Google OAuth 2.0 consent screen configured.
|
|
|
70
70
|
- On the **Create OAuth client ID** page, select **Web application** as the application type.
|
|
71
71
|
- Fill out the basic information for your application.
|
|
72
72
|
- Click **+ Add URI** to add an authorized domain to the **Authorized JavaScript origins** section. This is the domain that your logto authorization page will be served from. In our case, this will be `${your_logto_origin}`. e.g.`https://logto.dev`.
|
|
73
|
-
- Click **+ Add URI** in the ****Authorized redirect URIs**** section to set up the ****Authorized redirect URIs****, which redirect the user to the application after logging in. In our case, this will be `${your_logto_endpoint}/callback
|
|
73
|
+
- Click **+ Add URI** in the ****Authorized redirect URIs**** section to set up the ****Authorized redirect URIs****, which redirect the user to the application after logging in. In our case, this will be `${your_logto_endpoint}/callback/${connector_id}`. e.g. `https://logto.dev/callback/${connector_id}`. The `connector_id` can be found on the top bar of the Logto Admin Console connector details page.
|
|
74
74
|
- Click **Create** to finish and then you will get the **Client ID** and **Client Secret**.
|
|
75
75
|
|
|
76
76
|
### Config types
|
|
@@ -127,7 +127,7 @@ Now you should have the Google OAuth 2.0 consent screen configured.
|
|
|
127
127
|
- 在「创建 OAuth 客户端 ID」页面内,将「应用类型」设置为「Web 应用」。
|
|
128
128
|
- 填写相关的应用基本信息。
|
|
129
129
|
- 在「已获授权的 JavaScript 来源」中,点击「+ 添加URI」,该 URI 值为你所部署的 Logto 服务的地址。此处这个值应为 `${your_logto_origin}`。例如:`https://logto.dev`。
|
|
130
|
-
- 在「已获授权的重定向 URI」中,点击「+ 添加URI」以添加「已获授权的重定向 URI」。「已获授权的重定向 URI」将在用户使用 Google 帐号成功登录 Logto 后将用户重定向回你的应用。此处这个值应为 `${your_logto_endpoint}/callback
|
|
130
|
+
- 在「已获授权的重定向 URI」中,点击「+ 添加URI」以添加「已获授权的重定向 URI」。「已获授权的重定向 URI」将在用户使用 Google 帐号成功登录 Logto 后将用户重定向回你的应用。此处这个值应为 `${your_logto_endpoint}/callback/${connector_id}`。`connector_id` 在管理控制台相应连接器的详情页的顶栏中可以找到。例如:`https://logto.dev/callback/${connector_id}`。
|
|
131
131
|
- 点击「创建」后,你将获得「客户端 ID」(Client ID)和「客户端密钥」(Client Secret)。
|
|
132
132
|
|
|
133
133
|
### 配置类型
|
package/lib/index.js
CHANGED
|
@@ -2462,7 +2462,7 @@ const cacheable_lookup_1 = __nccwpck_require__(2074);
|
|
|
2462
2462
|
const CacheableRequest = __nccwpck_require__(5967);
|
|
2463
2463
|
const decompressResponse = __nccwpck_require__(1331);
|
|
2464
2464
|
// @ts-expect-error Missing types
|
|
2465
|
-
const http2wrapper = __nccwpck_require__(
|
|
2465
|
+
const http2wrapper = __nccwpck_require__(8670);
|
|
2466
2466
|
const lowercaseKeys = __nccwpck_require__(2893);
|
|
2467
2467
|
const is_1 = __nccwpck_require__(6198);
|
|
2468
2468
|
const get_body_size_1 = __nccwpck_require__(7408);
|
|
@@ -6861,7 +6861,7 @@ module.exports = IncomingMessage;
|
|
|
6861
6861
|
|
|
6862
6862
|
/***/ }),
|
|
6863
6863
|
|
|
6864
|
-
/***/
|
|
6864
|
+
/***/ 8670:
|
|
6865
6865
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6866
6866
|
|
|
6867
6867
|
"use strict";
|
|
@@ -14947,7 +14947,7 @@ exports.NEVER = parseUtil_1.INVALID;
|
|
|
14947
14947
|
|
|
14948
14948
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14949
14949
|
exports.defaultTimeout = exports.defaultMetadata = exports.scope = exports.userInfoEndpoint = exports.accessTokenEndpoint = exports.authorizationEndpoint = void 0;
|
|
14950
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
14950
|
+
const connector_kit_1 = __nccwpck_require__(2448);
|
|
14951
14951
|
exports.authorizationEndpoint = 'https://accounts.google.com/o/oauth2/v2/auth';
|
|
14952
14952
|
exports.accessTokenEndpoint = 'https://oauth2.googleapis.com/token';
|
|
14953
14953
|
exports.userInfoEndpoint = 'https://openidconnect.googleapis.com/v1/userinfo';
|
|
@@ -15008,7 +15008,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
15008
15008
|
};
|
|
15009
15009
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15010
15010
|
exports.getAccessToken = void 0;
|
|
15011
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15011
|
+
const connector_kit_1 = __nccwpck_require__(2448);
|
|
15012
15012
|
const essentials_1 = __nccwpck_require__(5254);
|
|
15013
15013
|
const got_1 = __importStar(__nccwpck_require__(9235));
|
|
15014
15014
|
const constant_1 = __nccwpck_require__(2124);
|
|
@@ -15255,13 +15255,13 @@ module.exports = require("zlib");
|
|
|
15255
15255
|
|
|
15256
15256
|
/***/ }),
|
|
15257
15257
|
|
|
15258
|
-
/***/
|
|
15258
|
+
/***/ 2448:
|
|
15259
15259
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15260
15260
|
|
|
15261
15261
|
"use strict";
|
|
15262
15262
|
|
|
15263
15263
|
|
|
15264
|
-
var types = __nccwpck_require__(
|
|
15264
|
+
var types = __nccwpck_require__(6430);
|
|
15265
15265
|
|
|
15266
15266
|
function validateConfig(config, guard) {
|
|
15267
15267
|
const result = guard.safeParse(config);
|
|
@@ -15292,27 +15292,32 @@ Object.defineProperty(exports, "ConnectorType", ({
|
|
|
15292
15292
|
enumerable: true,
|
|
15293
15293
|
get: function () { return types.ConnectorType; }
|
|
15294
15294
|
}));
|
|
15295
|
-
Object.defineProperty(exports, "
|
|
15295
|
+
Object.defineProperty(exports, "MessageType", ({
|
|
15296
|
+
enumerable: true,
|
|
15297
|
+
get: function () { return types.MessageType; }
|
|
15298
|
+
}));
|
|
15299
|
+
Object.defineProperty(exports, "VerificationCodeType", ({
|
|
15296
15300
|
enumerable: true,
|
|
15297
|
-
get: function () { return types.
|
|
15301
|
+
get: function () { return types.VerificationCodeType; }
|
|
15298
15302
|
}));
|
|
15299
15303
|
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
15300
15304
|
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
15301
15305
|
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
15302
15306
|
exports.messageTypesGuard = types.messageTypesGuard;
|
|
15307
|
+
exports.verificationCodeTypeGuard = types.verificationCodeTypeGuard;
|
|
15303
15308
|
exports.parseJson = parseJson;
|
|
15304
15309
|
exports.validateConfig = validateConfig;
|
|
15305
15310
|
|
|
15306
15311
|
|
|
15307
15312
|
/***/ }),
|
|
15308
15313
|
|
|
15309
|
-
/***/
|
|
15314
|
+
/***/ 6430:
|
|
15310
15315
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15311
15316
|
|
|
15312
15317
|
"use strict";
|
|
15313
15318
|
|
|
15314
15319
|
|
|
15315
|
-
var languageKit = __nccwpck_require__(
|
|
15320
|
+
var languageKit = __nccwpck_require__(3142);
|
|
15316
15321
|
var zod = __nccwpck_require__(6319);
|
|
15317
15322
|
|
|
15318
15323
|
// MARK: Foundation
|
|
@@ -15368,15 +15373,27 @@ class ConnectorError extends Error {
|
|
|
15368
15373
|
this.data = typeof data === 'string' ? { message: data } : data;
|
|
15369
15374
|
}
|
|
15370
15375
|
}
|
|
15371
|
-
exports.
|
|
15372
|
-
(function (
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
|
|
15376
|
-
|
|
15377
|
-
|
|
15378
|
-
})(exports.
|
|
15379
|
-
const
|
|
15376
|
+
exports.VerificationCodeType = void 0;
|
|
15377
|
+
(function (VerificationCodeType) {
|
|
15378
|
+
VerificationCodeType["SignIn"] = "SignIn";
|
|
15379
|
+
VerificationCodeType["Register"] = "Register";
|
|
15380
|
+
VerificationCodeType["ForgotPassword"] = "ForgotPassword";
|
|
15381
|
+
VerificationCodeType["Continue"] = "Continue";
|
|
15382
|
+
VerificationCodeType["Test"] = "Test";
|
|
15383
|
+
})(exports.VerificationCodeType || (exports.VerificationCodeType = {}));
|
|
15384
|
+
const verificationCodeTypeGuard = zod.z.nativeEnum(exports.VerificationCodeType);
|
|
15385
|
+
// Enum is string actually, keep this exported until GA for compatibility.
|
|
15386
|
+
/** @deprecated Use `VerificationCodeType` instead. */
|
|
15387
|
+
exports.MessageType = void 0;
|
|
15388
|
+
(function (MessageType) {
|
|
15389
|
+
MessageType["SignIn"] = "SignIn";
|
|
15390
|
+
MessageType["Register"] = "Register";
|
|
15391
|
+
MessageType["ForgotPassword"] = "ForgotPassword";
|
|
15392
|
+
MessageType["Continue"] = "Continue";
|
|
15393
|
+
MessageType["Test"] = "Test";
|
|
15394
|
+
})(exports.MessageType || (exports.MessageType = {}));
|
|
15395
|
+
/** @deprecated Use `verificationCodeTypeGuard` instead. */
|
|
15396
|
+
const messageTypesGuard = verificationCodeTypeGuard;
|
|
15380
15397
|
const connectorMetadataGuard = zod.z.object({
|
|
15381
15398
|
id: zod.z.string(),
|
|
15382
15399
|
target: zod.z.string(),
|
|
@@ -15407,11 +15424,12 @@ exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
|
15407
15424
|
exports.connectorSessionGuard = connectorSessionGuard;
|
|
15408
15425
|
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
15409
15426
|
exports.messageTypesGuard = messageTypesGuard;
|
|
15427
|
+
exports.verificationCodeTypeGuard = verificationCodeTypeGuard;
|
|
15410
15428
|
|
|
15411
15429
|
|
|
15412
15430
|
/***/ }),
|
|
15413
15431
|
|
|
15414
|
-
/***/
|
|
15432
|
+
/***/ 2885:
|
|
15415
15433
|
/***/ ((__unused_webpack_module, exports) => {
|
|
15416
15434
|
|
|
15417
15435
|
"use strict";
|
|
@@ -15548,14 +15566,14 @@ exports.languages = languages;
|
|
|
15548
15566
|
|
|
15549
15567
|
/***/ }),
|
|
15550
15568
|
|
|
15551
|
-
/***/
|
|
15569
|
+
/***/ 3142:
|
|
15552
15570
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15553
15571
|
|
|
15554
15572
|
"use strict";
|
|
15555
15573
|
|
|
15556
15574
|
|
|
15557
|
-
var _const = __nccwpck_require__(
|
|
15558
|
-
var utility = __nccwpck_require__(
|
|
15575
|
+
var _const = __nccwpck_require__(2885);
|
|
15576
|
+
var utility = __nccwpck_require__(5134);
|
|
15559
15577
|
|
|
15560
15578
|
|
|
15561
15579
|
|
|
@@ -15566,14 +15584,14 @@ exports.languageTagGuard = utility.languageTagGuard;
|
|
|
15566
15584
|
|
|
15567
15585
|
/***/ }),
|
|
15568
15586
|
|
|
15569
|
-
/***/
|
|
15587
|
+
/***/ 5134:
|
|
15570
15588
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15571
15589
|
|
|
15572
15590
|
"use strict";
|
|
15573
15591
|
|
|
15574
15592
|
|
|
15575
15593
|
var zod = __nccwpck_require__(6319);
|
|
15576
|
-
var _const = __nccwpck_require__(
|
|
15594
|
+
var _const = __nccwpck_require__(2885);
|
|
15577
15595
|
|
|
15578
15596
|
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
15579
15597
|
const languageTagGuard = zod.z
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"logo-dark.svg"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@logto/connector-kit": "1.0.0-beta.
|
|
12
|
+
"@logto/connector-kit": "1.0.0-beta.32",
|
|
13
13
|
"@silverhand/essentials": "^1.2.0",
|
|
14
14
|
"got": "^11.8.2",
|
|
15
15
|
"snakecase-keys": "^5.1.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"name": "@logto/connector-google",
|
|
48
|
-
"version": "1.0.0-beta.
|
|
48
|
+
"version": "1.0.0-beta.16",
|
|
49
49
|
"description": "Google web connector implementation.",
|
|
50
50
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
51
51
|
"scripts": {
|