(
request: Request,
token: str = Body(...),
password: str = Body(...),
user_manager: BaseUserManager[models.UP, models.ID] = Depends(get_user_manager),
)
| 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…