Updated the user auth and user auth key email endpoints and functions.

This commit is contained in:
Scott Idem
2025-04-08 15:34:58 -04:00
parent 573f054ee2
commit 8bd5fd2106
2 changed files with 15 additions and 5 deletions

View File

@@ -796,12 +796,15 @@ async def lookup_username(
# ### BEGIN ### API User ### email_auth_key_url() ###
# Updated 2021-12-02
# This requires the user_id and root_url or base_url.
# This endpoint will generate a new user auth_key and send the email to the user's email address.
# Updated 2025-04-08
# @router.get('/user/email_auth_key_url', response_model=Resp_Body_Base)
@router.get('/user/{user_id}/email_auth_key_url', response_model=Resp_Body_Base)
async def email_auth_key_url(
user_id: str = Path(min_length=11, max_length=22),
root_url: Optional[str] = Query(None, min_length=10, max_length=100), # Absolute min = 7
key_param_name: str = Query('auth_key', min_length=2, max_length=10),
return_obj: bool = False,
commons: Common_Route_Params = Depends(common_route_params),
):
@@ -817,6 +820,7 @@ async def email_auth_key_url(
account_id = account_id,
user_id = user_id,
root_url = root_url,
key_param_name = key_param_name,
):
log.info('Email with auth key log in URL was sent.')
return mk_resp(data=True, response=commons.response)