diff options
author | Jesse Luehrs <doy@tozt.net> | 2019-11-27 11:29:09 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2019-11-27 11:29:09 -0500 |
commit | a7ebc62a80933a73eae2282827e74dfaeb107820 (patch) | |
tree | ab3c9972f36926e67961eb09e23a700cba7479c2 /teleterm/src/cmd/web.rs | |
parent | a7b13be27b7398c84296ef82ba60b7a441a3fb0f (diff) | |
download | teleterm-a7ebc62a80933a73eae2282827e74dfaeb107820.tar.gz teleterm-a7ebc62a80933a73eae2282827e74dfaeb107820.zip |
calculate the redirect_url for web oauth too
a bit more complicated because it needs to use the configured
public_address, etc
Diffstat (limited to 'teleterm/src/cmd/web.rs')
-rw-r--r-- | teleterm/src/cmd/web.rs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/teleterm/src/cmd/web.rs b/teleterm/src/cmd/web.rs index 889179b..a9dc830 100644 --- a/teleterm/src/cmd/web.rs +++ b/teleterm/src/cmd/web.rs @@ -38,9 +38,20 @@ impl crate::config::Config for Config { self.oauth_configs .iter() .filter_map(|(ty, configs)| { - configs - .get(&crate::protocol::AuthClient::Web) - .map(|config| (*ty, config.clone())) + configs.get(&crate::protocol::AuthClient::Web).map( + |config| { + let mut config = config.clone(); + // TODO: tls + let url = url::Url::parse(&format!( + "http://{}/oauth/{}", + self.web.public_address, + ty.name() + )) + .unwrap(); + config.set_redirect_url(url); + (*ty, config) + }, + ) }) .collect(), )) |