Skip to content

Commit ca4b483

Browse files
dhleongdevsnek
authored andcommitted
Add support for prompt param to login/authorize
Per the documentation here: https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-authorization-url-example This param allows clients to pass "none" to avoid re-prompting for authorization every time the client connects.
1 parent 31c6635 commit ca4b483

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class RPCClient extends EventEmitter {
194194
* @returns {Promise}
195195
* @private
196196
*/
197-
async authorize({ scopes, clientSecret, rpcToken, redirectUri } = {}) {
197+
async authorize({ scopes, clientSecret, rpcToken, redirectUri, prompt } = {}) {
198198
if (clientSecret && rpcToken === true) {
199199
const body = await this.fetch('POST', '/oauth2/token/rpc', {
200200
data: new URLSearchParams({
@@ -208,6 +208,7 @@ class RPCClient extends EventEmitter {
208208
const { code } = await this.request('AUTHORIZE', {
209209
scopes,
210210
client_id: this.clientId,
211+
prompt,
211212
rpc_token: rpcToken,
212213
});
213214

0 commit comments

Comments
 (0)