|
40 | 40 | ) |
41 | 41 | from supertokens_python.recipe.webauthn.api.implementation import APIImplementation |
42 | 42 | from supertokens_python.recipe.webauthn.api.recover_account import recover_account_api |
| 43 | +from supertokens_python.recipe.webauthn.api.register_credentials import ( |
| 44 | + register_credential_api, |
| 45 | +) |
43 | 46 | from supertokens_python.recipe.webauthn.api.register_options import register_options_api |
44 | 47 | from supertokens_python.recipe.webauthn.api.sign_in import sign_in_api |
45 | 48 | from supertokens_python.recipe.webauthn.api.sign_in_options import sign_in_options_api |
46 | 49 | from supertokens_python.recipe.webauthn.api.sign_up import sign_up_api |
47 | 50 | from supertokens_python.recipe.webauthn.constants import ( |
48 | 51 | GENERATE_RECOVER_ACCOUNT_TOKEN_API, |
49 | 52 | RECOVER_ACCOUNT_API, |
| 53 | + REGISTER_CREDENTIAL_API, |
50 | 54 | REGISTER_OPTIONS_API, |
51 | 55 | SIGN_IN_API, |
52 | 56 | SIGN_UP_API, |
@@ -365,6 +369,12 @@ def get_apis_handled(self) -> List[APIHandled]: |
365 | 369 | request_id=SIGNUP_EMAIL_EXISTS_API, |
366 | 370 | disabled=self.api_implementation.disable_email_exists_get, |
367 | 371 | ), |
| 372 | + APIHandled( |
| 373 | + method="post", |
| 374 | + path_without_api_base_path=NormalisedURLPath(REGISTER_CREDENTIAL_API), |
| 375 | + request_id=REGISTER_CREDENTIAL_API, |
| 376 | + disabled=self.api_implementation.disable_register_credential_post, |
| 377 | + ), |
368 | 378 | ] |
369 | 379 |
|
370 | 380 | async def handle_api_request( |
@@ -425,6 +435,11 @@ async def handle_api_request( |
425 | 435 | self.api_implementation, tenant_id, options, user_context |
426 | 436 | ) |
427 | 437 |
|
| 438 | + if request_id == REGISTER_CREDENTIAL_API: |
| 439 | + return await register_credential_api( |
| 440 | + self.api_implementation, tenant_id, options, user_context |
| 441 | + ) |
| 442 | + |
428 | 443 | return None |
429 | 444 |
|
430 | 445 | def is_error_from_this_recipe_based_on_instance(self, err: Exception): |
|
0 commit comments