13 lines
499 B
Rust
13 lines
499 B
Rust
use std::env;
|
|
|
|
use rocket::response::Redirect;
|
|
|
|
#[get("/login")]
|
|
pub fn login() -> Redirect {
|
|
Redirect::to(format!(
|
|
// Switch from response_type=code to response_type=token from URL generator
|
|
"https://discord.com/api/oauth2/authorize?client_id={client_id}&redirect_uri={redirect_uri}&response_type=token&scope=identify%20guilds.join%20guilds",
|
|
client_id = env::var("CLIENT_ID").unwrap(),
|
|
redirect_uri = format!("{}success", env::var("DOMAIN").unwrap()),
|
|
))
|
|
}
|