From 8fd7bc8da7b353b5dec22ac4a5b6e907ae511ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABlle=20Huisman?= Date: Fri, 13 Mar 2026 16:08:22 +0100 Subject: [PATCH] fix(dummy): add submit button to sign in form --- .../shield-dummy/src/actions/sign_in.rs | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/methods/shield-dummy/src/actions/sign_in.rs b/packages/methods/shield-dummy/src/actions/sign_in.rs index 5ba22c4..2512e9d 100644 --- a/packages/methods/shield-dummy/src/actions/sign_in.rs +++ b/packages/methods/shield-dummy/src/actions/sign_in.rs @@ -3,8 +3,9 @@ use std::sync::Arc; use async_trait::async_trait; use serde::Deserialize; use shield::{ - Action, ActionMethod, Form, Input, InputType, InputTypeText, MethodSession, Request, Response, - ResponseType, SessionAction, ShieldError, SignInAction, Storage, User, erased_action, + Action, ActionMethod, Form, Input, InputType, InputTypeSubmit, InputTypeText, InputValue, + MethodSession, Request, Response, ResponseType, SessionAction, ShieldError, SignInAction, + Storage, User, erased_action, }; use crate::provider::DummyProvider; @@ -49,18 +50,30 @@ impl Action for DummySignInAction { async fn forms(&self, _provider: DummyProvider) -> Result, ShieldError> { Ok(vec![Form { - inputs: vec![Input { - name: "userId".to_owned(), - label: Some("User ID".to_owned()), - r#type: InputType::Text(InputTypeText { - placeholder: Some("User ID".to_owned()), - required: Some(true), - ..Default::default() - }), - value: None, - addon_start: None, - addon_end: None, - }], + inputs: vec![ + Input { + name: "userId".to_owned(), + label: Some("User ID".to_owned()), + r#type: InputType::Text(InputTypeText { + placeholder: Some("User ID".to_owned()), + required: Some(true), + ..Default::default() + }), + value: None, + addon_start: None, + addon_end: None, + }, + Input { + name: "submit".to_owned(), + label: None, + r#type: InputType::Submit(InputTypeSubmit::default()), + value: Some(InputValue::String { + value: "Sign in with dummy".to_owned(), + }), + addon_start: None, + addon_end: None, + }, + ], }]) }