Initiates a password reset flow by sending a reset email to the user.
(request: Request, body: PasswordResetSchema)
| 523 | |
| 524 | @public_route |
| 525 | async def auth_password_reset(request: Request, body: PasswordResetSchema) -> StatusResponse: |
| 526 | """ |
| 527 | Initiates a password reset flow by sending a reset email to the user. |
| 528 | """ |
| 529 | supabase = get_supabase() |
| 530 | |
| 531 | try: |
| 532 | # Use the frontend callback URL, same as the invite flow |
| 533 | redirect_url = f"{APP_URL}/auth/callback" |
| 534 | auth_response = supabase.auth.reset_password_for_email(body.email, {"redirect_to": redirect_url}) |
| 535 | except gotrue.errors.AuthApiError as e: |
| 536 | raise AuthException.from_gotrue_autherror(e) |
| 537 | |
| 538 | if hasattr(auth_response, 'error'): |
| 539 | raise AuthException("Failed to send password reset email.") |
| 540 | |
| 541 | return StatusResponse(message="Password reset email sent successfully.") |
| 542 | |
| 543 | |
| 544 | async def auth_logout(request: Request) -> StatusResponse: |
nothing calls this directly
no test coverage detected
searching dependent graphs…