@@ -5,8 +5,8 @@ use chrono::Utc;
55use serde:: Deserialize ;
66use shield:: {
77 Action , ActionMethod , CreateEmailAddress , CreateUser , Form , Input , InputType , InputTypeEmail ,
8- InputTypeSubmit , InputValue , MethodSession , Request , Response , ResponseType , SessionAction ,
9- ShieldError , SignInCallbackAction , User , erased_action,
8+ InputTypeSubmit , InputTypeText , InputValue , MethodSession , Request , Response , ResponseType ,
9+ SessionAction , ShieldError , SignInCallbackAction , User , erased_action,
1010} ;
1111
1212use crate :: {
@@ -51,7 +51,7 @@ impl<U: User + 'static> Action<EmailProvider, ()> for EmailSignInCallbackAction<
5151 }
5252
5353 fn method ( & self ) -> ActionMethod {
54- ActionMethod :: Get
54+ ActionMethod :: Post
5555 }
5656
5757 fn condition (
@@ -74,19 +74,23 @@ impl<U: User + 'static> Action<EmailProvider, ()> for EmailSignInCallbackAction<
7474 required: Some ( true ) ,
7575 ..Default :: default ( )
7676 } ) ,
77- value: None ,
77+ value: Some ( InputValue :: Query {
78+ key: "email" . to_owned( ) ,
79+ } ) ,
7880 addon_start: None ,
7981 addon_end: None ,
8082 } ,
8183 Input {
8284 name: "token" . to_owned( ) ,
8385 label: Some ( "Token" . to_owned( ) ) ,
84- r#type: InputType :: Email ( InputTypeEmail {
86+ r#type: InputType :: Text ( InputTypeText {
8587 placeholder: Some ( "Token" . to_owned( ) ) ,
8688 required: Some ( true ) ,
8789 ..Default :: default ( )
8890 } ) ,
89- value: None ,
91+ value: Some ( InputValue :: Query {
92+ key: "token" . to_owned( ) ,
93+ } ) ,
9094 addon_start: None ,
9195 addon_end: None ,
9296 } ,
@@ -147,7 +151,10 @@ impl<U: User + 'static> Action<EmailProvider, ()> for EmailSignInCallbackAction<
147151 }
148152 } ;
149153
150- Ok ( Response :: new ( ResponseType :: Default ) . session_action ( SessionAction :: authenticate ( user) ) )
154+ Ok ( Response :: new ( ResponseType :: Redirect (
155+ self . options . sign_in_redirect . clone ( ) ,
156+ ) )
157+ . session_action ( SessionAction :: authenticate ( user) ) )
151158 }
152159}
153160
0 commit comments