@@ -104,6 +104,34 @@ pub struct ImportPreference {
104104 pub action : ImportAction ,
105105}
106106
107+ /// Should the email address be marked as verified
108+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Default , JsonSchema ) ]
109+ #[ serde( rename_all = "lowercase" ) ]
110+ pub enum SetEmailVerification {
111+ /// Mark the email address as verified
112+ Always ,
113+
114+ /// Don't mark the email address as verified
115+ Never ,
116+
117+ /// Mark the email address as verified if the upstream provider says it is
118+ /// through the `email_verified` claim
119+ #[ default]
120+ Import ,
121+ }
122+
123+ /// What should be done with the email claim
124+ #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Default , JsonSchema ) ]
125+ pub struct EmailImportPreference {
126+ /// How to handle the claim
127+ #[ serde( default ) ]
128+ pub action : ImportAction ,
129+
130+ /// Should the email address be marked as verified
131+ #[ serde( default ) ]
132+ pub set_email_verification : SetEmailVerification ,
133+ }
134+
107135/// How claims should be imported
108136#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize , Default , JsonSchema ) ]
109137pub struct ClaimsImports {
@@ -118,7 +146,7 @@ pub struct ClaimsImports {
118146 /// Import the email address of the user based on the `email` and
119147 /// `email_verified` claims
120148 #[ serde( default ) ]
121- pub email : Option < ImportPreference > ,
149+ pub email : Option < EmailImportPreference > ,
122150}
123151
124152#[ skip_serializing_none]
0 commit comments