Skip to content

Commit 16c70ca

Browse files
committed
Fix: github auth
1 parent 321af11 commit 16c70ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/cmd/auth.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use serde::{Deserialize, Serialize};
55
use serde_yaml;
66
use std::fs::{File, OpenOptions};
77
use std::path::PathBuf;
8-
use urlencoding;
98
use webbrowser;
109

1110
use crate::service; // Assuming service::create_client is needed
@@ -57,6 +56,10 @@ struct AuthInitResponse {
5756
pub async fn run_auth(reset: bool, auth_provider: &str) -> Result<()> {
5857
println!("Attempting authentication via {}...", auth_provider);
5958

59+
if auth_provider == "discord" {
60+
panic!("Discord authentication is not supported yet... WIP");
61+
}
62+
6063
let popcorn_api_url = std::env::var("POPCORN_API_URL")
6164
.map_err(|_| anyhow!("POPCORN_API_URL environment variable not set"))?;
6265

@@ -91,17 +94,14 @@ pub async fn run_auth(reset: bool, auth_provider: &str) -> Result<()> {
9194

9295
let auth_url = match auth_provider {
9396
"discord" => {
94-
let base_auth_url = "https://discord.com/oauth2/authorize?client_id=1357446383497511096&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fauth%2Fcli%2Fdiscord&scope=identify";
97+
let base_auth_url = "https://discord.com/oauth2/authorize?client_id=1361364685491802243&response_type=code&redirect_uri=https%3A%2F%2Fdiscord-cluster-manager-1f6c4782e60a.herokuapp.com%2Fauth%2Fcli%2Fdiscord&scope=identify";
9598
format!("{}&state={}", base_auth_url, state_b64)
9699
}
97100
"github" => {
98101
let client_id = "Ov23lieFd2onYk4OnKIR";
99-
let redirect_uri = "http://localhost:8000/auth/cli/github";
100-
// URL encode the redirect URI
101-
let encoded_redirect_uri = urlencoding::encode(redirect_uri);
102102
format!(
103-
"https://github.com/login/oauth/authorize?client_id={}&redirect_uri={}&state={}",
104-
client_id, encoded_redirect_uri, state_b64
103+
"https://github.com/login/oauth/authorize?client_id={}&state={}",
104+
client_id, state_b64
105105
)
106106
}
107107
_ => {

0 commit comments

Comments
 (0)