diff --git a/backend/app.py b/backend/app.py index 067d4e14b3cbf94dde567d2e8819cbc504255928..896f1035fd748df697776c66690ada75f16bd637 100644 --- a/backend/app.py +++ b/backend/app.py @@ -120,7 +120,6 @@ jwt = JWTManager(app) def expired_token_callback(*args): return jsonify({"errorMessage": "Unauthorized"}), 401 - @app.route("/") def index(): return "Stackspin API v1.0" diff --git a/backend/areas/users/user_service.py b/backend/areas/users/user_service.py index a586926128644c0be3f3287b963bdd239bdde318..0e982eb713964994b7cfd2372e4c70329c167b80 100644 --- a/backend/areas/users/user_service.py +++ b/backend/areas/users/user_service.py @@ -1,7 +1,7 @@ import ory_kratos_client from ory_kratos_client.model.update_recovery_flow_body \ import UpdateRecoveryFlowBody -from ory_kratos_client.api import identity_api +from ory_kratos_client.api import frontend_api, identity_api from config import KRATOS_ADMIN_URL from database import db @@ -16,6 +16,7 @@ from helpers.error_handler import KratosError kratos_admin_api_configuration = \ ory_kratos_client.Configuration(host=KRATOS_ADMIN_URL, discard_unknown_keys=True) kratos_client = ory_kratos_client.ApiClient(kratos_admin_api_configuration) +kratos_frontend_api = frontend_api.FrontendApi(kratos_client) kratos_identity_api = identity_api.IdentityApi(kratos_client) class UserService: @@ -87,12 +88,12 @@ class UserService: :param email: Email to send recovery link to :type email: str """ - api_response = kratos_identity_api.create_native_recovery_flow() + api_response = kratos_frontend_api.create_native_recovery_flow() flow = api_response['id'] # Submit the recovery flow to send an email to the new user. update_recovery_flow_body = \ UpdateRecoveryFlowBody(method="link", email=email) - api_response = kratos_identity_api.submit_self_service_recovery_flow(flow, + api_response = kratos_frontend_api.update_recovery_flow(flow, update_recovery_flow_body=update_recovery_flow_body) @staticmethod