aboutsummaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/cli.rs8
-rw-r--r--src/config/mod.rs3
2 files changed, 7 insertions, 4 deletions
diff --git a/src/config/cli.rs b/src/config/cli.rs
index 7bc6312..be1b913 100644
--- a/src/config/cli.rs
+++ b/src/config/cli.rs
@@ -1,6 +1,8 @@
use std::path::PathBuf;
use clap::Parser;
+#[cfg(feature = "oauth-discord")]
+use secrecy::SecretString;
use serde::Deserialize;
use url::Url;
@@ -48,7 +50,7 @@ pub struct Cli {
/// Oauth optionas
#[command(flatten)]
#[cfg(feature = "oauth")]
- pub oauth: Option<OAuth>,
+ pub oauth: OAuth,
}
#[derive(Debug, Clone, Parser, Deserialize)]
@@ -61,12 +63,12 @@ pub struct OAuth {
}
#[cfg(feature = "oauth-discord")]
-#[derive(Debug, Clone, Parser, Deserialize)]
+#[derive(Debug, Clone, Parser, Deserialize, Default)]
pub struct DiscordOauth {
#[arg(long, env = "OAUTH_DISCORD_CLIENT_ID")]
discord_client_id: Option<String>,
#[arg(long, env = "OAUTH_DISCORD_CLIENT_SECRET")]
- discord_client_secret: Option<String>,
+ discord_client_secret: Option<SecretString>,
#[arg(
long,
env = "OAUTH_DISCORD_TOKEN_URL",
diff --git a/src/config/mod.rs b/src/config/mod.rs
index aa6f770..0c53f08 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -74,7 +74,7 @@ pub struct DiscordOauth {
#[cfg(feature = "oauth-discord")]
fn discord_token_url() -> Url {
- Url::parse("https://discord.com/api/oauth2/authorize?response_type=code").expect("valid url")
+ Url::parse("https://discord.com/api/oauth2/token").expect("valid url")
}
#[cfg(feature = "oauth-discord")]
@@ -195,6 +195,7 @@ impl Config {
if let Some(db_url) = &cli.db {
dsn.url = db_url.clone();
}
+
}
}