@@ -3,8 +3,9 @@ use std::sync::Arc;
33use async_trait:: async_trait;
44use serde:: Deserialize ;
55use shield:: {
6- Action , ActionMethod , Form , Input , InputType , InputTypeText , MethodSession , Request , Response ,
7- ResponseType , SessionAction , ShieldError , SignInAction , Storage , User , erased_action,
6+ Action , ActionMethod , Form , Input , InputType , InputTypeSubmit , InputTypeText , InputValue ,
7+ MethodSession , Request , Response , ResponseType , SessionAction , ShieldError , SignInAction ,
8+ Storage , User , erased_action,
89} ;
910
1011use crate :: provider:: DummyProvider ;
@@ -49,18 +50,30 @@ impl<U: User + 'static> Action<DummyProvider, ()> for DummySignInAction<U> {
4950
5051 async fn forms ( & self , _provider : DummyProvider ) -> Result < Vec < Form > , ShieldError > {
5152 Ok ( vec ! [ Form {
52- inputs: vec![ Input {
53- name: "userId" . to_owned( ) ,
54- label: Some ( "User ID" . to_owned( ) ) ,
55- r#type: InputType :: Text ( InputTypeText {
56- placeholder: Some ( "User ID" . to_owned( ) ) ,
57- required: Some ( true ) ,
58- ..Default :: default ( )
59- } ) ,
60- value: None ,
61- addon_start: None ,
62- addon_end: None ,
63- } ] ,
53+ inputs: vec![
54+ Input {
55+ name: "userId" . to_owned( ) ,
56+ label: Some ( "User ID" . to_owned( ) ) ,
57+ r#type: InputType :: Text ( InputTypeText {
58+ placeholder: Some ( "User ID" . to_owned( ) ) ,
59+ required: Some ( true ) ,
60+ ..Default :: default ( )
61+ } ) ,
62+ value: None ,
63+ addon_start: None ,
64+ addon_end: None ,
65+ } ,
66+ Input {
67+ name: "submit" . to_owned( ) ,
68+ label: None ,
69+ r#type: InputType :: Submit ( InputTypeSubmit :: default ( ) ) ,
70+ value: Some ( InputValue :: String {
71+ value: "Sign in with dummy" . to_owned( ) ,
72+ } ) ,
73+ addon_start: None ,
74+ addon_end: None ,
75+ } ,
76+ ] ,
6477 } ] )
6578 }
6679
0 commit comments