From 0ecea0fde96ac0409f346511f1c8108e1aa73078 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 26 Nov 2019 11:50:06 -0500 Subject: read the oauth method configs in the webface the oauth login link doesn't work yet, but the ui works at least --- teleterm-web/src/model.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'teleterm-web/src/model.rs') diff --git a/teleterm-web/src/model.rs b/teleterm-web/src/model.rs index 05e3152..c500600 100644 --- a/teleterm-web/src/model.rs +++ b/teleterm-web/src/model.rs @@ -187,6 +187,20 @@ impl Model { } } + pub(crate) fn allowed_login_method( + &self, + ty: crate::protocol::AuthType, + ) -> bool { + self.config.allowed_login_methods.contains(&ty) + } + + pub(crate) fn oauth_login_url( + &self, + ty: crate::protocol::AuthType, + ) -> Option<&str> { + self.config.oauth_login_urls.get(&ty).map(|s| s.as_str()) + } + fn login(&self, username: &str, orders: &mut impl Orders) { let url = format!( "http://{}/login?username={}", -- cgit v1.2.3-54-g00ecf