@logto/connector-discord 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 +8 -7
- package/lib/index.js +43 -25
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
The Discord connector provides a way for your application to use Discord as an authorization system.
|
|
4
4
|
|
|
5
5
|
**Table of contents**
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
9
|
-
- [
|
|
10
|
-
|
|
6
|
+
- [Discord OAuth2 Connector](#discord-oauth2-connector)
|
|
7
|
+
- [Register a developer application](#register-a-developer-application)
|
|
8
|
+
- [Configure Logto](#configure-logto)
|
|
9
|
+
- [Config types](#config-types)
|
|
10
|
+
- [clientId](#clientid)
|
|
11
|
+
- [clientSecret](#clientsecret)
|
|
11
12
|
|
|
12
13
|
## Register a developer application
|
|
13
14
|
- Visit [Discord Developer Portal](https://discord.com/developers/applications) and sign in with your Discord account.
|
|
14
15
|
- Click the **New Application** button to create an application, choose a name for it (Ex: LogtoAuth), tick the box and click **Create**.
|
|
15
16
|
- Go to **OAuth2** page and click **Reset Secret**
|
|
16
17
|
- Take note of the **CLIENT ID** and **CLIENT SECRET** fields
|
|
17
|
-
- Add the valid redirects (Ex: **`http://auth.mycompany.io/callback
|
|
18
|
+
- Add the valid redirects (Ex: **`http://auth.mycompany.io/callback/${connector_id}`**). The `connector_id` can be found on the top bar of the Logto Admin Console connector details page.
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
## Configure Logto
|
|
@@ -32,4 +33,4 @@ The Discord connector provides a way for your application to use Discord as an a
|
|
|
32
33
|
|
|
33
34
|
#### clientSecret
|
|
34
35
|
`clientSecret` is the `CLIENT SECRET` we saved earlier.
|
|
35
|
-
(If you've lost it you need to click **Reset Secret**)
|
|
36
|
+
(If you've lost it you need to click **Reset Secret**)
|
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
|
/**
|
|
14952
14952
|
* Base authorization URL.
|
|
14953
14953
|
* https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-urls
|
|
@@ -15022,7 +15022,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
15022
15022
|
};
|
|
15023
15023
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
15024
15024
|
exports.getAccessToken = void 0;
|
|
15025
|
-
const connector_kit_1 = __nccwpck_require__(
|
|
15025
|
+
const connector_kit_1 = __nccwpck_require__(2448);
|
|
15026
15026
|
const essentials_1 = __nccwpck_require__(5254);
|
|
15027
15027
|
const got_1 = __importStar(__nccwpck_require__(9235));
|
|
15028
15028
|
const constant_1 = __nccwpck_require__(2124);
|
|
@@ -15264,13 +15264,13 @@ module.exports = require("zlib");
|
|
|
15264
15264
|
|
|
15265
15265
|
/***/ }),
|
|
15266
15266
|
|
|
15267
|
-
/***/
|
|
15267
|
+
/***/ 2448:
|
|
15268
15268
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15269
15269
|
|
|
15270
15270
|
"use strict";
|
|
15271
15271
|
|
|
15272
15272
|
|
|
15273
|
-
var types = __nccwpck_require__(
|
|
15273
|
+
var types = __nccwpck_require__(6430);
|
|
15274
15274
|
|
|
15275
15275
|
function validateConfig(config, guard) {
|
|
15276
15276
|
const result = guard.safeParse(config);
|
|
@@ -15301,27 +15301,32 @@ Object.defineProperty(exports, "ConnectorType", ({
|
|
|
15301
15301
|
enumerable: true,
|
|
15302
15302
|
get: function () { return types.ConnectorType; }
|
|
15303
15303
|
}));
|
|
15304
|
-
Object.defineProperty(exports, "
|
|
15304
|
+
Object.defineProperty(exports, "MessageType", ({
|
|
15305
|
+
enumerable: true,
|
|
15306
|
+
get: function () { return types.MessageType; }
|
|
15307
|
+
}));
|
|
15308
|
+
Object.defineProperty(exports, "VerificationCodeType", ({
|
|
15305
15309
|
enumerable: true,
|
|
15306
|
-
get: function () { return types.
|
|
15310
|
+
get: function () { return types.VerificationCodeType; }
|
|
15307
15311
|
}));
|
|
15308
15312
|
exports.configurableConnectorMetadataGuard = types.configurableConnectorMetadataGuard;
|
|
15309
15313
|
exports.connectorSessionGuard = types.connectorSessionGuard;
|
|
15310
15314
|
exports.i18nPhrasesGuard = types.i18nPhrasesGuard;
|
|
15311
15315
|
exports.messageTypesGuard = types.messageTypesGuard;
|
|
15316
|
+
exports.verificationCodeTypeGuard = types.verificationCodeTypeGuard;
|
|
15312
15317
|
exports.parseJson = parseJson;
|
|
15313
15318
|
exports.validateConfig = validateConfig;
|
|
15314
15319
|
|
|
15315
15320
|
|
|
15316
15321
|
/***/ }),
|
|
15317
15322
|
|
|
15318
|
-
/***/
|
|
15323
|
+
/***/ 6430:
|
|
15319
15324
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15320
15325
|
|
|
15321
15326
|
"use strict";
|
|
15322
15327
|
|
|
15323
15328
|
|
|
15324
|
-
var languageKit = __nccwpck_require__(
|
|
15329
|
+
var languageKit = __nccwpck_require__(3142);
|
|
15325
15330
|
var zod = __nccwpck_require__(6319);
|
|
15326
15331
|
|
|
15327
15332
|
// MARK: Foundation
|
|
@@ -15377,15 +15382,27 @@ class ConnectorError extends Error {
|
|
|
15377
15382
|
this.data = typeof data === 'string' ? { message: data } : data;
|
|
15378
15383
|
}
|
|
15379
15384
|
}
|
|
15380
|
-
exports.
|
|
15381
|
-
(function (
|
|
15382
|
-
|
|
15383
|
-
|
|
15384
|
-
|
|
15385
|
-
|
|
15386
|
-
|
|
15387
|
-
})(exports.
|
|
15388
|
-
const
|
|
15385
|
+
exports.VerificationCodeType = void 0;
|
|
15386
|
+
(function (VerificationCodeType) {
|
|
15387
|
+
VerificationCodeType["SignIn"] = "SignIn";
|
|
15388
|
+
VerificationCodeType["Register"] = "Register";
|
|
15389
|
+
VerificationCodeType["ForgotPassword"] = "ForgotPassword";
|
|
15390
|
+
VerificationCodeType["Continue"] = "Continue";
|
|
15391
|
+
VerificationCodeType["Test"] = "Test";
|
|
15392
|
+
})(exports.VerificationCodeType || (exports.VerificationCodeType = {}));
|
|
15393
|
+
const verificationCodeTypeGuard = zod.z.nativeEnum(exports.VerificationCodeType);
|
|
15394
|
+
// Enum is string actually, keep this exported until GA for compatibility.
|
|
15395
|
+
/** @deprecated Use `VerificationCodeType` instead. */
|
|
15396
|
+
exports.MessageType = void 0;
|
|
15397
|
+
(function (MessageType) {
|
|
15398
|
+
MessageType["SignIn"] = "SignIn";
|
|
15399
|
+
MessageType["Register"] = "Register";
|
|
15400
|
+
MessageType["ForgotPassword"] = "ForgotPassword";
|
|
15401
|
+
MessageType["Continue"] = "Continue";
|
|
15402
|
+
MessageType["Test"] = "Test";
|
|
15403
|
+
})(exports.MessageType || (exports.MessageType = {}));
|
|
15404
|
+
/** @deprecated Use `verificationCodeTypeGuard` instead. */
|
|
15405
|
+
const messageTypesGuard = verificationCodeTypeGuard;
|
|
15389
15406
|
const connectorMetadataGuard = zod.z.object({
|
|
15390
15407
|
id: zod.z.string(),
|
|
15391
15408
|
target: zod.z.string(),
|
|
@@ -15416,11 +15433,12 @@ exports.configurableConnectorMetadataGuard = configurableConnectorMetadataGuard;
|
|
|
15416
15433
|
exports.connectorSessionGuard = connectorSessionGuard;
|
|
15417
15434
|
exports.i18nPhrasesGuard = i18nPhrasesGuard;
|
|
15418
15435
|
exports.messageTypesGuard = messageTypesGuard;
|
|
15436
|
+
exports.verificationCodeTypeGuard = verificationCodeTypeGuard;
|
|
15419
15437
|
|
|
15420
15438
|
|
|
15421
15439
|
/***/ }),
|
|
15422
15440
|
|
|
15423
|
-
/***/
|
|
15441
|
+
/***/ 2885:
|
|
15424
15442
|
/***/ ((__unused_webpack_module, exports) => {
|
|
15425
15443
|
|
|
15426
15444
|
"use strict";
|
|
@@ -15557,14 +15575,14 @@ exports.languages = languages;
|
|
|
15557
15575
|
|
|
15558
15576
|
/***/ }),
|
|
15559
15577
|
|
|
15560
|
-
/***/
|
|
15578
|
+
/***/ 3142:
|
|
15561
15579
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15562
15580
|
|
|
15563
15581
|
"use strict";
|
|
15564
15582
|
|
|
15565
15583
|
|
|
15566
|
-
var _const = __nccwpck_require__(
|
|
15567
|
-
var utility = __nccwpck_require__(
|
|
15584
|
+
var _const = __nccwpck_require__(2885);
|
|
15585
|
+
var utility = __nccwpck_require__(5134);
|
|
15568
15586
|
|
|
15569
15587
|
|
|
15570
15588
|
|
|
@@ -15575,14 +15593,14 @@ exports.languageTagGuard = utility.languageTagGuard;
|
|
|
15575
15593
|
|
|
15576
15594
|
/***/ }),
|
|
15577
15595
|
|
|
15578
|
-
/***/
|
|
15596
|
+
/***/ 5134:
|
|
15579
15597
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
15580
15598
|
|
|
15581
15599
|
"use strict";
|
|
15582
15600
|
|
|
15583
15601
|
|
|
15584
15602
|
var zod = __nccwpck_require__(6319);
|
|
15585
|
-
var _const = __nccwpck_require__(
|
|
15603
|
+
var _const = __nccwpck_require__(2885);
|
|
15586
15604
|
|
|
15587
15605
|
const isLanguageTag = (value) => typeof value === 'string' && value in _const.languages;
|
|
15588
15606
|
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-discord",
|
|
48
|
-
"version": "1.0.0-beta.
|
|
48
|
+
"version": "1.0.0-beta.16",
|
|
49
49
|
"description": "Discord connector implementation.",
|
|
50
50
|
"author": "ZR3SYSTEMS. <https://github.com/FlurryNight>",
|
|
51
51
|
"scripts": {
|