From ec317a0d77176e095a830c8c241f43d9154a5627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 18 Jul 2023 14:49:56 +0200 Subject: [PATCH] auth-dialog: Implement dummy stage It is not supposed to require user interaction so it's a waste to use the fallback URL. --- src/components/auth_dialog.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/auth_dialog.rs b/src/components/auth_dialog.rs index ec87ac2c..55f876fc 100644 --- a/src/components/auth_dialog.rs +++ b/src/components/auth_dialog.rs @@ -241,6 +241,7 @@ impl AuthDialog { match stage { AuthType::Password => Some(self.perform_password_stage(session.clone()).await), AuthType::Sso => Some(self.perform_fallback(session.clone(), stage).await), + AuthType::Dummy => Some(self.perform_dummy_stage(session.clone())), // TODO implement other authentication types // See: https://gitlab.gnome.org/GNOME/fractal/-/issues/835 _ => None, @@ -264,6 +265,11 @@ impl AuthDialog { Ok(AuthData::Password(data)) } + /// Performs the dummy stage. + fn perform_dummy_stage(&self, session: Option) -> Result { + Ok(AuthData::Dummy(assign!(Dummy::new(), { session }))) + } + /// Performs a web-based fallback for the given stage. async fn perform_fallback( &self,