Add optional OAuth 2.0 user_scope to redirect url (#330)

* Add OAuth 2.0 `user_scope` to redirect url

* Make OAuth field `user_scope` optional
This commit is contained in:
Robin 2025-08-18 15:57:57 +02:00 committed by GitHub
parent 14546c5e0f
commit 236ab3070a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View file

@ -34,6 +34,7 @@ impl<H: 'static + Send + Sync + Connect + Clone> SlackEventsAxumListener<H> {
&vec![
("client_id", Some(config.client_id.value())),
("scope", Some(&config.bot_scope)),
("user_scope", config.user_scope.as_ref()),
(
"redirect_uri",
Some(config.to_redirect_url()?.as_str().to_string()).as_ref(),

View file

@ -26,6 +26,7 @@ impl<H: 'static + Send + Sync + Connect + Clone> SlackClientEventsHyperListener<
&vec![
("client_id", Some(config.client_id.value())),
("scope", Some(&config.bot_scope)),
("user_scope", config.user_scope.as_ref()),
(
"redirect_uri",
Some(config.to_redirect_url()?.as_str().to_string()).as_ref(),

View file

@ -137,6 +137,7 @@ pub struct SlackOAuthListenerConfig {
pub client_id: SlackClientId,
pub client_secret: SlackClientSecret,
pub bot_scope: String,
pub user_scope: Option<String>,
pub redirect_callback_host: String,
#[default = "SlackOAuthListenerConfig::DEFAULT_INSTALL_PATH_VALUE.into()"]
pub install_path: String,