File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
supertokens_python/recipe/webauthn Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -93,13 +93,16 @@ async def register_options(
93
93
has_email_input : bool = False
94
94
has_recover_account_token_input : bool = False
95
95
96
- if "email" in kwargs :
96
+ if "email" in kwargs and kwargs . get ( "email" ) is not None :
97
97
has_email_input = True
98
98
kwargs_obj = DisplayNameEmailInput (
99
99
email = kwargs ["email" ],
100
100
display_name = kwargs .get ("display_name" ),
101
101
)
102
- elif "recover_account_token" in kwargs :
102
+ elif (
103
+ "recover_account_token" in kwargs
104
+ and kwargs .get ("recover_account_token" ) is not None
105
+ ):
103
106
has_recover_account_token_input = True
104
107
kwargs_obj = RecoverAccountTokenInput (
105
108
recover_account_token = kwargs ["recover_account_token" ],
@@ -134,6 +137,10 @@ async def register_options(
134
137
if login_method .recipe_user_id .get_as_string () == user_id :
135
138
email = login_method .email
136
139
break
140
+ else :
141
+ raise Exception (
142
+ "should never come here: Either `email` or `recover_aacount_token` should be specified"
143
+ )
137
144
138
145
if email is None :
139
146
return InvalidEmailErrorResponse (err = "The email is missing" )
You can’t perform that action at this time.
0 commit comments