@@ -201,8 +201,7 @@ def test_validate_challenge_returns_success_true_if_no_user_id_is_provided(self)
201
201
'state' : 'CHALLENGE_SUCCEEDED' ,
202
202
'stateUpdatedAt' : '2024-07-11T22:39:23.613Z' ,
203
203
'userId' : 'legitimate_user_id' ,
204
- 'action' : 'signin' ,
205
- 'actionCode' : 'signin' ,
204
+ 'action' : 'signin' ,
206
205
'idempotencyKey' : '6d09db21-1aa9-4b7f-826f-dbc6a0af79eb' ,
207
206
'verificationMethod' : 'EMAIL_MAGIC_LINK'
208
207
},
@@ -215,5 +214,25 @@ def test_validate_challenge_returns_success_true_if_no_user_id_is_provided(self)
215
214
self .assertEqual (response ["state" ], "CHALLENGE_SUCCEEDED" )
216
215
self .assertTrue (response ["is_valid" ])
217
216
217
+ @responses .activate
218
+ def test_action_code_is_omitted_from_validate_challenge_response (self ):
219
+ responses .add (responses .POST , f"{ base_url } /validate" ,
220
+ json = {
221
+ 'isValid' : True ,
222
+ 'state' : 'CHALLENGE_SUCCEEDED' ,
223
+ 'stateUpdatedAt' : '2024-07-11T22:39:23.613Z' ,
224
+ 'userId' : 'legitimate_user_id' ,
225
+ 'action' : 'signin' ,
226
+ 'actionCode' : 'signin' ,
227
+ 'idempotencyKey' : '6d09db21-1aa9-4b7f-826f-dbc6a0af79eb' ,
228
+ 'verificationMethod' : 'EMAIL_MAGIC_LINK'
229
+ },
230
+ status = 200
231
+ )
232
+
233
+ response = self .authsignal_client .validate_challenge (token = self .jwt_token )
234
+
235
+ self .assertNotIn ("action_code" , response )
236
+
218
237
if __name__ == "__main__" :
219
238
unittest .main ()
0 commit comments