|
|
@ -2,17 +2,17 @@
|
|
|
|
extern crate rocket;
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
|
|
|
|
use core::panic;
|
|
|
|
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::collections::HashMap;
|
|
|
|
use std::convert::Infallible;
|
|
|
|
use std::convert::Infallible;
|
|
|
|
use std::env;
|
|
|
|
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 std::fs;
|
|
|
|
use sass_rocket_fairing::SassFairing;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mod challenge;
|
|
|
|
mod challenge;
|
|
|
|
use challenge::Challenge;
|
|
|
|
use challenge::Challenge;
|
|
|
@ -108,13 +108,16 @@ fn logout(cookies: &CookieJar<'_>, referer: Referer) -> Redirect {
|
|
|
|
params.insert("token", token);
|
|
|
|
params.insert("token", token);
|
|
|
|
params
|
|
|
|
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")
|
|
|
|
.header("Content-Type", "application/x-www-form-urlencoded")
|
|
|
|
.form(¶ms)
|
|
|
|
.form(¶ms)
|
|
|
|
.send().await {
|
|
|
|
.send()
|
|
|
|
Ok(_) => println!("Successfully revoked token"),
|
|
|
|
.await
|
|
|
|
Err(error) => println!("Failed to revoke token: {:?}", error),
|
|
|
|
{
|
|
|
|
};
|
|
|
|
Ok(_) => println!("Successfully revoked token"),
|
|
|
|
|
|
|
|
Err(error) => println!("Failed to revoke token: {:?}", error),
|
|
|
|
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
cookies.remove_private(Cookie::named(TOKEN_COOKIE));
|
|
|
|
cookies.remove_private(Cookie::named(TOKEN_COOKIE));
|
|
|
|
let redirect_url = referer.0.unwrap_or("/".to_owned());
|
|
|
|
let redirect_url = referer.0.unwrap_or("/".to_owned());
|
|
|
|