MCPcopy Index your code
hub / github.com/fastapi-users/fastapi-users / forgot_password

Function forgot_password

fastapi_users/router/reset.py:46–61  ·  view source on GitHub ↗
(
        request: Request,
        email: EmailStr = Body(..., embed=True),
        user_manager: BaseUserManager[models.UP, models.ID] = Depends(get_user_manager),
    )

Source from the content-addressed store, hash-verified

44 name="reset:forgot_password",
45 )
46 async def forgot_password(
47 request: Request,
48 email: EmailStr = Body(..., embed=True),
49 user_manager: BaseUserManager[models.UP, models.ID] = Depends(get_user_manager),
50 ):
51 try:
52 user = await user_manager.get_by_email(email)
53 except exceptions.UserNotExists:
54 return None
55
56 try:
57 await user_manager.forgot_password(user, request)
58 except exceptions.UserInactive:
59 pass
60
61 return None
62
63 @router.post(
64 "/reset-password",

Callers

nothing calls this directly

Calls 2

forgot_passwordMethod · 0.80
get_by_emailMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…