|
|
|
@ -2,17 +2,17 @@
|
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
|
|
use core::panic;
|
|
|
|
|
use rocket::fs::{relative, FileServer};
|
|
|
|
|
use rocket::http::{Cookie, CookieJar};
|
|
|
|
|
use rocket::request::{FlashMessage, FromRequest};
|
|
|
|
|
use rocket::response::{Flash, Redirect};
|
|
|
|
|
use rocket::{request, Request};
|
|
|
|
|
use rocket_dyn_templates::{context, Template};
|
|
|
|
|
use sass_rocket_fairing::SassFairing;
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
use std::convert::Infallible;
|
|
|
|
|
use std::env;
|
|
|
|
|
use rocket::fs::{FileServer, relative};
|
|
|
|
|
use rocket::{Request, request};
|
|
|
|
|
use rocket::http::{Cookie, CookieJar};
|
|
|
|
|
use rocket::request::{FromRequest, FlashMessage};
|
|
|
|
|
use rocket::response::{Redirect, Flash};
|
|
|
|
|
use rocket_dyn_templates::{context, Template};
|
|
|
|
|
use std::fs;
|
|
|
|
|
use sass_rocket_fairing::SassFairing;
|
|
|
|
|
|
|
|
|
|
mod challenge;
|
|
|
|
|
use challenge::Challenge;
|
|
|
|
@ -108,13 +108,16 @@ fn logout(cookies: &CookieJar<'_>, referer: Referer) -> Redirect {
|
|
|
|
|
params.insert("token", token);
|
|
|
|
|
params
|
|
|
|
|
};
|
|
|
|
|
match client.post("https://discord.com/api/oauth2/token/revoke")
|
|
|
|
|
match client
|
|
|
|
|
.post("https://discord.com/api/oauth2/token/revoke")
|
|
|
|
|
.header("Content-Type", "application/x-www-form-urlencoded")
|
|
|
|
|
.form(¶ms)
|
|
|
|
|
.send().await {
|
|
|
|
|
Ok(_) => println!("Successfully revoked token"),
|
|
|
|
|
Err(error) => println!("Failed to revoke token: {:?}", error),
|
|
|
|
|
};
|
|
|
|
|
.send()
|
|
|
|
|
.await
|
|
|
|
|
{
|
|
|
|
|
Ok(_) => println!("Successfully revoked token"),
|
|
|
|
|
Err(error) => println!("Failed to revoke token: {:?}", error),
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
cookies.remove_private(Cookie::named(TOKEN_COOKIE));
|
|
|
|
|
let redirect_url = referer.0.unwrap_or("/".to_owned());
|
|
|
|
|