@logto/connector-discord 1.0.0-beta.4
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/LICENSE +21 -0
- package/README.md +35 -0
- package/docs/config-template.json +4 -0
- package/lib/index.js +14986 -0
- package/lib/jest.config.d.ts +3 -0
- package/lib/src/constant.d.ts +19 -0
- package/lib/src/index.d.ts +14 -0
- package/lib/src/index.test.d.ts +1 -0
- package/lib/src/mock.d.ts +4 -0
- package/lib/src/types.d.ts +69 -0
- package/logo.svg +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Silverhand
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Discord OAuth2 Connector
|
|
2
|
+
|
|
3
|
+
The Discord connector provides a way for your application to use Discord as an authorization system.
|
|
4
|
+
|
|
5
|
+
**Table of contents**
|
|
6
|
+
- [Register a developer application](#register-a-developer-application)
|
|
7
|
+
- [Configure Logto](#configure-logto)
|
|
8
|
+
- [Config types](#config-types)
|
|
9
|
+
- [clientId](#clientid)
|
|
10
|
+
- [clientSecret](#clientseceret)
|
|
11
|
+
|
|
12
|
+
## Register a developer application
|
|
13
|
+
- Visit [Discord Developer Portal](https://discord.com/developers/applications) and sign in with your Discord account.
|
|
14
|
+
- Click the **New Application** button to create an application, choose a name for it (Ex: LogtoAuth), tick the box and click **Create**.
|
|
15
|
+
- Go to **OAuth2** page and click **Reset Secret**
|
|
16
|
+
- Take note of the **CLIENT ID** and **CLIENT SECRET** fields
|
|
17
|
+
- Add the valid redirects (Ex: **`http://auth.mycompany.io/callback/discord-universal`**)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Configure Logto
|
|
21
|
+
|
|
22
|
+
### Config types
|
|
23
|
+
|
|
24
|
+
| Name | Type |
|
|
25
|
+
|--------------|---------|
|
|
26
|
+
| clientId | string |
|
|
27
|
+
| clientSecret | string |
|
|
28
|
+
|
|
29
|
+
#### clientId
|
|
30
|
+
`clientId` is the `CLIENT ID` field we saved earlier.
|
|
31
|
+
(You can find it in the Oauth2 Page in Discord Developer Portal.)
|
|
32
|
+
|
|
33
|
+
#### clientSecret
|
|
34
|
+
`clientSecret` is the `CLIENT SECRET` we saved earlier.
|
|
35
|
+
(If you've lost it you need to click **Reset Secret**)
|