patched discord rpc for refresh token
This commit is contained in:
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