diff options
| author | Austin Hellyer <[email protected]> | 2017-01-01 14:12:57 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2017-01-01 20:47:43 -0800 |
| commit | 70bf22a00cd19651a0d994cc43e8d8c4bd8947fc (patch) | |
| tree | 78db495e97b09b3b40512a7e6f3d1cef2154fa34 /src | |
| parent | Implement context message queueing (diff) | |
| download | serenity-70bf22a00cd19651a0d994cc43e8d8c4bd8947fc.tar.xz serenity-70bf22a00cd19651a0d994cc43e8d8c4bd8947fc.zip | |
Remove user logout endpoint
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/mod.rs | 19 | ||||
| -rw-r--r-- | src/client/rest/mod.rs | 7 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs index ab4b47c..48a38ed 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -37,7 +37,6 @@ pub use self::login_type::LoginType; use self::dispatch::dispatch; use self::event_store::EventStore; use self::gateway::Shard; -use serde_json::builder::ObjectBuilder; use std::collections::{BTreeMap, HashMap}; use std::sync::{Arc, Mutex, RwLock}; use std::thread; @@ -215,24 +214,6 @@ impl Client { login(&user_token.to_owned(), LoginType::User) } - /// Logout from the Discord API. This theoretically is supposed to - /// invalidate the current token, but currently does not do anything. This - /// is an issue on Discord's side. - /// - /// **Note**: This can only be used by users. - pub fn logout(self) -> Result<()> { - if self.login_type == LoginType::Bot { - return Err(Error::Client(ClientError::InvalidOperationAsBot)); - } - - let map = ObjectBuilder::new() - .insert("provider", Value::Null) - .insert("token", Value::Null) - .build(); - - rest::logout(map) - } - /// Sets a framework to be used with the client. All message events will be /// passed through the framework _after_ being passed to the [`on_message`] /// event handler. diff --git a/src/client/rest/mod.rs b/src/client/rest/mod.rs index 6ecbd94..a2e475d 100644 --- a/src/client/rest/mod.rs +++ b/src/client/rest/mod.rs @@ -1412,13 +1412,6 @@ pub fn leave_guild(guild_id: u64) -> Result<PartialGuild> { PartialGuild::decode(serde_json::from_reader(response)?) } -/// Logs out. That's supposed to disable the token but doesn't. -pub fn logout(map: Value) -> Result<()> { - let body = serde_json::to_string(&map)?; - - verify(204, request!(Route::None, post(body), "/auth/logout")) -} - /// Deletes a user from group DM. pub fn remove_group_recipient(group_id: u64, user_id: u64) -> Result<()> { |