diff --git a/backend/main.py b/backend/main.py index 59c1ea0..e2c84d0 100644 --- a/backend/main.py +++ b/backend/main.py @@ -29,6 +29,7 @@ from auth import ( get_user, change_password, delete_me, + reset_password, ) from permissions import ( @@ -122,6 +123,9 @@ class RoomCreate(BaseModel): pattern=r"^[A-Za-z0-9]+$", ) +class ForgotPassword(BaseModel): + email: EmailStr + class RoomSearch(BaseModel): invite_code: str @@ -1120,6 +1124,16 @@ def api_verify_email(token: str = Query(...)): """ +@app.post( + "/forgot-password", + summary="Request password reset", + description="Sends a password reset email if the email address exists.", +) +def api_forgot_password( + data: ForgotPassword, +): + return reset_password(data.email) + # easter egg @app.get(