replace tmp variable name, doc improvements
This commit is contained in:
parent
685ddeff00
commit
cc7fc5ab91
3 changed files with 24 additions and 13 deletions
|
|
@ -9,8 +9,10 @@ from areas.apps.models import App, AppRole
|
|||
from areas.roles.role_service import RoleService
|
||||
from helpers import KratosApi
|
||||
|
||||
tmp = ory_kratos_client.Configuration(host=KRATOS_ADMIN_URL, discard_unknown_keys=True)
|
||||
KRATOS_ADMIN = kratos_api.V0alpha2Api(ory_kratos_client.ApiClient(tmp))
|
||||
kratos_admin_api_configuration = \
|
||||
ory_kratos_client.Configuration(host=KRATOS_ADMIN_URL, discard_unknown_keys=True)
|
||||
KRATOS_ADMIN = \
|
||||
kratos_api.V0alpha2Api(ory_kratos_client.ApiClient(kratos_admin_api_configuration))
|
||||
|
||||
class UserService:
|
||||
@staticmethod
|
||||
|
|
@ -51,18 +53,19 @@ class UserService:
|
|||
db.session.add(app_role)
|
||||
db.session.commit()
|
||||
|
||||
UserService.__start_user_recovery_flow(data["email"])
|
||||
UserService.__start_recovery_flow(data["email"])
|
||||
|
||||
return UserService.get_user(res["id"])
|
||||
|
||||
|
||||
@staticmethod
|
||||
def __start_user_recovery_flow(email):
|
||||
def __start_recovery_flow(email):
|
||||
"""
|
||||
Start a Kratos recovery flow for the user's email address.
|
||||
|
||||
This sends out an email to the user that explains to them how they can
|
||||
set their password.
|
||||
set their password. Make sure the user exists inside Kratos before you
|
||||
use this function.
|
||||
|
||||
:param email: Email to send recovery link to
|
||||
:type email: str
|
||||
|
|
|
|||
Reference in a new issue