auth-dialog: Implement dummy stage
It is not supposed to require user interaction so it's a waste to use the fallback URL.
This commit is contained in:
parent
e8ed5a99a5
commit
ec317a0d77
1 changed files with 6 additions and 0 deletions
|
@ -241,6 +241,7 @@ impl AuthDialog {
|
||||||
match stage {
|
match stage {
|
||||||
AuthType::Password => Some(self.perform_password_stage(session.clone()).await),
|
AuthType::Password => Some(self.perform_password_stage(session.clone()).await),
|
||||||
AuthType::Sso => Some(self.perform_fallback(session.clone(), stage).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
|
// TODO implement other authentication types
|
||||||
// See: https://gitlab.gnome.org/GNOME/fractal/-/issues/835
|
// See: https://gitlab.gnome.org/GNOME/fractal/-/issues/835
|
||||||
_ => None,
|
_ => None,
|
||||||
|
@ -264,6 +265,11 @@ impl AuthDialog {
|
||||||
Ok(AuthData::Password(data))
|
Ok(AuthData::Password(data))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Performs the dummy stage.
|
||||||
|
fn perform_dummy_stage(&self, session: Option<String>) -> Result<AuthData, AuthError> {
|
||||||
|
Ok(AuthData::Dummy(assign!(Dummy::new(), { session })))
|
||||||
|
}
|
||||||
|
|
||||||
/// Performs a web-based fallback for the given stage.
|
/// Performs a web-based fallback for the given stage.
|
||||||
async fn perform_fallback(
|
async fn perform_fallback(
|
||||||
&self,
|
&self,
|
||||||
|
|
Loading…
Reference in a new issue