aboutsummaryrefslogtreecommitdiffstats
path: root/teleterm/src/oauth/recurse_center.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-11-26 04:20:43 -0500
committerJesse Luehrs <doy@tozt.net>2019-11-26 04:20:43 -0500
commitea8beb985247aac4345ecefc8ec551f52f5f1a24 (patch)
tree7288af40b291e03252cfca7bb4654b63181776ed /teleterm/src/oauth/recurse_center.rs
parentcc5a3f9056fe1b563dbb40d51b1621769150c08d (diff)
downloadteleterm-ea8beb985247aac4345ecefc8ec551f52f5f1a24.tar.gz
teleterm-ea8beb985247aac4345ecefc8ec551f52f5f1a24.zip
allow multiple oauth configurations using the same auth type
this should allow us to configure a separate oauth application for tt web than normal (since the redirect_url needs to be different)
Diffstat (limited to 'teleterm/src/oauth/recurse_center.rs')
-rw-r--r--teleterm/src/oauth/recurse_center.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/teleterm/src/oauth/recurse_center.rs b/teleterm/src/oauth/recurse_center.rs
index 6eeb69c..c43be15 100644
--- a/teleterm/src/oauth/recurse_center.rs
+++ b/teleterm/src/oauth/recurse_center.rs
@@ -13,7 +13,11 @@ impl RecurseCenter {
}
}
- pub fn config(client_id: &str, client_secret: &str) -> super::Config {
+ pub fn config(
+ client_id: &str,
+ client_secret: &str,
+ redirect_url: &url::Url,
+ ) -> super::Config {
super::Config {
client_id: client_id.to_string(),
client_secret: client_secret.to_string(),
@@ -23,7 +27,7 @@ impl RecurseCenter {
.unwrap(),
token_url: url::Url::parse("https://www.recurse.com/oauth/token")
.unwrap(),
- redirect_url: url::Url::parse(super::REDIRECT_URL).unwrap(),
+ redirect_url: redirect_url.clone(),
}
}
}