patched discord rpc for refresh token
This commit is contained in:
14
patches/@types__discord-rpc@4.0.10.patch
Normal file
14
patches/@types__discord-rpc@4.0.10.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/index.d.ts b/index.d.ts
|
||||
index 04480d88d0cd2e21f8a7e2ef9878d6984b14fff5..81285e7e54381362925cc93ccd3f51ff087b5763 100644
|
||||
--- a/index.d.ts
|
||||
+++ b/index.d.ts
|
||||
@@ -52,6 +52,9 @@ export class BaseClient extends EventEmitter {}
|
||||
* The main hub for interacting with Discord RPC
|
||||
*/
|
||||
export class Client extends BaseClient {
|
||||
+ accessToken: string | null;
|
||||
+ refreshToken: string | null;
|
||||
+ accessTokenExpiresAt: number | null;
|
||||
/**
|
||||
* @param options Options for the client.
|
||||
* You must provide a transport
|
||||
27
patches/discord-rpc@4.0.1.patch
Normal file
27
patches/discord-rpc@4.0.1.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
diff --git a/src/client.js b/src/client.js
|
||||
index 0ff29daa9ac1cd4f406944b3e195738d520b2c57..90ef5dc7228e8b1678f72e2573b42bd222a527c1 100644
|
||||
--- a/src/client.js
|
||||
+++ b/src/client.js
|
||||
@@ -32,6 +32,8 @@ class RPCClient extends EventEmitter {
|
||||
this.options = options;
|
||||
|
||||
this.accessToken = null;
|
||||
+ this.refreshToken = null;
|
||||
+ this.accessTokenExpiresAt = null;
|
||||
this.clientId = null;
|
||||
|
||||
/**
|
||||
@@ -222,6 +224,13 @@ class RPCClient extends EventEmitter {
|
||||
}),
|
||||
});
|
||||
|
||||
+ const {
|
||||
+ access_token, refresh_token, expires_in
|
||||
+ } = response;
|
||||
+
|
||||
+ this.refreshToken = refresh_token;
|
||||
+ this.accessTokenExpiresAt = Date.now() + (expires_in * 1000);
|
||||
+
|
||||
return response.access_token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user