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

Function reset_password

fastapi_users/router/reset.py:68–92  ·  view source on GitHub ↗
(
        request: Request,
        token: str = Body(...),
        password: str = Body(...),
        user_manager: BaseUserManager[models.UP, models.ID] = Depends(get_user_manager),
    )

Source from the content-addressed store, hash-verified

66 responses=RESET_PASSWORD_RESPONSES,
67 )
68 async def reset_password(
69 request: Request,
70 token: str = Body(...),
71 password: str = Body(...),
72 user_manager: BaseUserManager[models.UP, models.ID] = Depends(get_user_manager),
73 ):
74 try:
75 await user_manager.reset_password(token, password, request)
76 except (
77 exceptions.InvalidResetPasswordToken,
78 exceptions.UserNotExists,
79 exceptions.UserInactive,
80 ):
81 raise HTTPException(
82 status_code=status.HTTP_400_BAD_REQUEST,
83 detail=ErrorCode.RESET_PASSWORD_BAD_TOKEN,
84 )
85 except exceptions.InvalidPasswordException as e:
86 raise HTTPException(
87 status_code=status.HTTP_400_BAD_REQUEST,
88 detail={
89 "code": ErrorCode.RESET_PASSWORD_INVALID_PASSWORD,
90 "reason": e.reason,
91 },
92 )
93
94 return router

Callers

nothing calls this directly

Calls 1

reset_passwordMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…