discauth
v1.0.0
Published
A small wrapper for Discord's OAuth2
Downloads
1
Readme
Classes
Typedefs
OAuth
Kind: global class
Constructor(client_id, client_secret, redirect, scopes)
| Param | Type | | --- | --- | | client_id | String | | client_secret | String | | redirect | String | | scopes | Array.<String> |
oAuth.getCode(code, [type]) ⇒ Promise.<Object>
Kind: instance method of OAuth
| Param | Type | Description |
| --- | --- | --- |
| code | String | The code that was in the query |
| [type] | String | Code type. Can be authorization
or redirect
. It's authorzation
by default. |
Example
oauth.getCode(queryCode, "authorization")
.then(noauthInfo => {
console.log(`Your auth code is ${authInfo.authorization_token}`)
}
)