@logto/connector-github 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
|
@@ -38,7 +38,7 @@ Go to the [GitHub website](https://github.com/) and sign in with your GitHub acc
|
|
|
38
38
|
Follow the [creating an OAuth App](https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app) guide, and register a new application.
|
|
39
39
|
|
|
40
40
|
Name your new OAuth application in **Application name** and fill up **Homepage URL** of the app.
|
|
41
|
-
You can leave **Application description** field blank and customize **Authorization callback URL** as `${your_logto_origin}/callback
|
|
41
|
+
You can leave **Application description** field blank and customize **Authorization callback URL** as `${your_logto_origin}/callback/${connector_id}`. The `connector_id` can be found on the top bar of the Logto Admin Console connector details page.
|
|
42
42
|
|
|
43
43
|
We suggest not to check the box before **Enable Device Flow**, or users who sign in with GitHub on mobile devices must confirm the initial sign-in action in the GitHub app. Many GitHub users do not install the GitHub mobile app on their phones, which could block the sign-in flow. Please ignore our suggestion if you are expecting end-users to confirm their sign-in flow. See details of [device flow](https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#device-flow).
|
|
44
44
|
|
|
@@ -92,7 +92,7 @@ GitHub 连接器让终端用户可以用 GitHub 账号,通过 GitHub OAuth 2.0
|
|
|
92
92
|
跟随 [创建 _OAuth 应用程序_](https://docs.github.com/cn/developers/apps/building-oauth-apps/creating-an-oauth-app),注册一个新应用。
|
|
93
93
|
|
|
94
94
|
为新 _OAuth 应用程序_ 取名,并填入「Application name」栏;并填写应用的网页地址「Homepage URL」。
|
|
95
|
-
你需要将 `${your_logto_origin}/callback
|
|
95
|
+
你需要将 `${your_logto_origin}/callback/${connector_id}` 填写到「Authorization callback URL」栏;「Application description」栏可以选择留白。`connector_id` 在管理控制台相应连接器的详情页的顶栏中可以找到。
|
|
96
96
|
|
|
97
97
|
我们建议不要勾选「Enable Device Flow」,否则希望在移动设备上登录的用户需要在 GitHub 应用中确认登录的动作。许多 GitHub 用户在移动端设备上不会安装应用,这可能阻碍这些用户的登录流程。
|
|
98
98
|
|
package/lib/index.js
CHANGED
|
@@ -2589,7 +2589,7 @@ const cacheable_lookup_1 = __nccwpck_require__(2074);
|
|
|
2589
2589
|
const CacheableRequest = __nccwpck_require__(5967);
|
|
2590
2590
|
const decompressResponse = __nccwpck_require__(1331);
|
|
2591
2591
|
// @ts-expect-error Missing types
|
|
2592
|
-
const http2wrapper = __nccwpck_require__(
|
|
2592
|
+
const http2wrapper = __nccwpck_require__(8670);
|
|
2593
2593
|
const lowercaseKeys = __nccwpck_require__(2893);
|
|
2594
2594
|
const is_1 = __nccwpck_require__(6198);
|
|
2595
2595
|
const get_body_size_1 = __nccwpck_require__(7408);
|
|
@@ -6988,7 +6988,7 @@ module.exports = IncomingMessage;
|
|
|
6988
6988
|
|
|
6989
6989
|
/***/ }),
|
|
6990
6990
|
|
|
6991
|
-
/***/
|
|
6991
|
+
/***/ 8670:
|
|
6992
6992
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
6993
6993
|
|
|
6994
6994
|
"use strict";
|
|
@@ -15604,7 +15604,7 @@ exports.NEVER = parseUtil_1.INVALID;
|
|
|
15604
15604
|
|
|
15605
15605
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15606
15606
|
exports.defaultTimeout = exports.defaultMetadata = exports.userInfoEndpoint = exports.accessTokenEndpoint = exports.scope = exports.authorizationEndpoint = void 0;
|
|
15607
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15607
|
+
const connector_kit_1 = __nccwpck_require__(2448);
|
|
15608
15608
|
exports.authorizationEndpoint = 'https://github.com/login/oauth/authorize';
|
|
15609
15609
|
exports.scope = 'read:user';
|
|
15610
15610
|
exports.accessTokenEndpoint = 'https://github.com/login/oauth/access_token';
|
|
@@ -15665,7 +15665,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
15665
15665
|
};
|
|
15666
15666
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15667
15667
|
exports.getAccessToken = void 0;
|
|
15668
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15668
|
+
const connector_kit_1 = __nccwpck_require__(2448);
|
|
15669
15669
|
const essentials_1 = __nccwpck_require__(5254);
|
|
15670
15670
|
const got_1 = __importStar(__nccwpck_require__(9235));
|
|
15671
15671
|
const qs = __importStar(__nccwpck_require__(2024));
|
|
@@ -15916,13 +15916,13 @@ module.exports = require("zlib");
|
|
|
15916
15916
|
|
|
15917
15917
|
/***/ }),
|
|
15918
15918
|
|
|
15919
|
-
/***/
|
|
15919
|
+
/***/ 2448:
|
|
15920
15920
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15921
15921
|
|
|
15922
15922
|
"use strict";
|
|
15923
15923
|
|
|
15924
15924
|
|
|
15925
|
-
var types = __nccwpck_require__(
|
|
15925
|
+
var types = __nccwpck_require__(6430);
|
|
15926
15926
|
|
|
15927
15927
|
function validateConfig(config, guard) {
|
|
15928
15928
|
const result = guard.safeParse(config);
|
|
@@ -15953,27 +15953,32 @@ Object.defineProperty(exports, "ConnectorType", ({
|
|
|
15953
15953
|
enumerable: true,
|
|
15954
15954
|
get: function () { return types.ConnectorType; }
|
|
15955
15955
|
}));
|
|
15956
|
-
Object.defineProperty(exports, "
|
|
15956
|
+
Object.defineProperty(exports, "MessageType", ({
|
|
15957
|
+
enumerable: true,
|
|
15958
|
+
get: function () { return types.MessageType; }
|
|
15959
|
+
}));
|
|
15960
|
+
Object.defineProperty(exports, "VerificationCodeType", ({
|
|
15957
15961
|
enumerable: true,
|
|
15958
|
-
get: function () { return types.
|
|
15962
|
+
get: function () { return types.VerificationCodeType; }
|
|
15959
15963
|
}));
|
|
15960
15964
|
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
15961
15965
|
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
15962
15966
|
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
15963
15967
|
exports.messageTypesGuard = types.messageTypesGuard;
|
|
15968
|
+
exports.verificationCodeTypeGuard = types.verificationCodeTypeGuard;
|
|
15964
15969
|
exports.parseJson = parseJson;
|
|
15965
15970
|
exports.validateConfig = validateConfig;
|
|
15966
15971
|
|
|
15967
15972
|
|
|
15968
15973
|
/***/ }),
|
|
15969
15974
|
|
|
15970
|
-
/***/
|
|
15975
|
+
/***/ 6430:
|
|
15971
15976
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15972
15977
|
|
|
15973
15978
|
"use strict";
|
|
15974
15979
|
|
|
15975
15980
|
|
|
15976
|
-
var languageKit = __nccwpck_require__(
|
|
15981
|
+
var languageKit = __nccwpck_require__(3142);
|
|
15977
15982
|
var zod = __nccwpck_require__(6319);
|
|
15978
15983
|
|
|
15979
15984
|
// MARK: Foundation
|
|
@@ -16029,15 +16034,27 @@ class ConnectorError extends Error {
|
|
|
16029
16034
|
this.data = typeof data === 'string' ? { message: data } : data;
|
|
16030
16035
|
}
|
|
16031
16036
|
}
|
|
16032
|
-
exports.
|
|
16033
|
-
(function (
|
|
16034
|
-
|
|
16035
|
-
|
|
16036
|
-
|
|
16037
|
-
|
|
16038
|
-
|
|
16039
|
-
})(exports.
|
|
16040
|
-
const
|
|
16037
|
+
exports.VerificationCodeType = void 0;
|
|
16038
|
+
(function (VerificationCodeType) {
|
|
16039
|
+
VerificationCodeType["SignIn"] = "SignIn";
|
|
16040
|
+
VerificationCodeType["Register"] = "Register";
|
|
16041
|
+
VerificationCodeType["ForgotPassword"] = "ForgotPassword";
|
|
16042
|
+
VerificationCodeType["Continue"] = "Continue";
|
|
16043
|
+
VerificationCodeType["Test"] = "Test";
|
|
16044
|
+
})(exports.VerificationCodeType || (exports.VerificationCodeType = {}));
|
|
16045
|
+
const verificationCodeTypeGuard = zod.z.nativeEnum(exports.VerificationCodeType);
|
|
16046
|
+
// Enum is string actually, keep this exported until GA for compatibility.
|
|
16047
|
+
/** @deprecated Use `VerificationCodeType` instead. */
|
|
16048
|
+
exports.MessageType = void 0;
|
|
16049
|
+
(function (MessageType) {
|
|
16050
|
+
MessageType["SignIn"] = "SignIn";
|
|
16051
|
+
MessageType["Register"] = "Register";
|
|
16052
|
+
MessageType["ForgotPassword"] = "ForgotPassword";
|
|
16053
|
+
MessageType["Continue"] = "Continue";
|
|
16054
|
+
MessageType["Test"] = "Test";
|
|
16055
|
+
})(exports.MessageType || (exports.MessageType = {}));
|
|
16056
|
+
/** @deprecated Use `verificationCodeTypeGuard` instead. */
|
|
16057
|
+
const messageTypesGuard = verificationCodeTypeGuard;
|
|
16041
16058
|
const connectorMetadataGuard = zod.z.object({
|
|
16042
16059
|
id: zod.z.string(),
|
|
16043
16060
|
target: zod.z.string(),
|
|
@@ -16068,11 +16085,12 @@ exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
|
16068
16085
|
exports.connectorSessionGuard = connectorSessionGuard;
|
|
16069
16086
|
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
16070
16087
|
exports.messageTypesGuard = messageTypesGuard;
|
|
16088
|
+
exports.verificationCodeTypeGuard = verificationCodeTypeGuard;
|
|
16071
16089
|
|
|
16072
16090
|
|
|
16073
16091
|
/***/ }),
|
|
16074
16092
|
|
|
16075
|
-
/***/
|
|
16093
|
+
/***/ 2885:
|
|
16076
16094
|
/***/ ((__unused_webpack_module, exports) => {
|
|
16077
16095
|
|
|
16078
16096
|
"use strict";
|
|
@@ -16209,14 +16227,14 @@ exports.languages = languages;
|
|
|
16209
16227
|
|
|
16210
16228
|
/***/ }),
|
|
16211
16229
|
|
|
16212
|
-
/***/
|
|
16230
|
+
/***/ 3142:
|
|
16213
16231
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
16214
16232
|
|
|
16215
16233
|
"use strict";
|
|
16216
16234
|
|
|
16217
16235
|
|
|
16218
|
-
var _const = __nccwpck_require__(
|
|
16219
|
-
var utility = __nccwpck_require__(
|
|
16236
|
+
var _const = __nccwpck_require__(2885);
|
|
16237
|
+
var utility = __nccwpck_require__(5134);
|
|
16220
16238
|
|
|
16221
16239
|
|
|
16222
16240
|
|
|
@@ -16227,14 +16245,14 @@ exports.languageTagGuard = utility.languageTagGuard;
|
|
|
16227
16245
|
|
|
16228
16246
|
/***/ }),
|
|
16229
16247
|
|
|
16230
|
-
/***/
|
|
16248
|
+
/***/ 5134:
|
|
16231
16249
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
16232
16250
|
|
|
16233
16251
|
"use strict";
|
|
16234
16252
|
|
|
16235
16253
|
|
|
16236
16254
|
var zod = __nccwpck_require__(6319);
|
|
16237
|
-
var _const = __nccwpck_require__(
|
|
16255
|
+
var _const = __nccwpck_require__(2885);
|
|
16238
16256
|
|
|
16239
16257
|
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
16240
16258
|
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",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"name": "@logto/connector-github",
|
|
49
|
-
"version": "1.0.0-beta.
|
|
49
|
+
"version": "1.0.0-beta.16",
|
|
50
50
|
"description": "Github web connector implementation.",
|
|
51
51
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
52
52
|
"scripts": {
|