|
10 | 10 | from app.core.config import settings
|
11 | 11 | from app.core import security
|
12 | 12 | from app.utilities import (
|
13 |
| - send_email_validation_email, |
14 | 13 | send_new_account_email,
|
15 | 14 | )
|
16 | 15 |
|
@@ -111,48 +110,6 @@ def request_new_totp(
|
111 | 110 | return obj_in
|
112 | 111 |
|
113 | 112 |
|
114 |
| -# @router.post("/send-validation-email", response_model=schemas.Msg, status_code=201) |
115 |
| -# def send_validation_email( |
116 |
| -# *, |
117 |
| -# current_user: models.User = Depends(deps.get_current_active_user), |
118 |
| -# ) -> Any: |
119 |
| -# """ |
120 |
| -# Send validation email. |
121 |
| -# """ |
122 |
| -# password_validation_token = generate_password_reset_token(email=current_user.email) |
123 |
| -# data = schemas.EmailValidation( |
124 |
| -# **{ |
125 |
| -# "email": current_user.email, |
126 |
| -# "subject": "Validate your email address", |
127 |
| -# "token": password_validation_token, |
128 |
| -# } |
129 |
| -# ) |
130 |
| -# # EmailValidation |
131 |
| -# send_email_validation_email(data=data) |
132 |
| -# return {"msg": "Password validation email sent. Check your email and respond."} |
133 |
| - |
134 |
| - |
135 |
| -@router.post("/validate-email", response_model=schemas.Msg) |
136 |
| -def validate_email( |
137 |
| - *, |
138 |
| - db: Session = Depends(deps.get_db), |
139 |
| - payload: dict = Body(...), |
140 |
| - current_user: models.User = Depends(deps.get_current_active_user), |
141 |
| -) -> Any: |
142 |
| - """ |
143 |
| - Reset password |
144 |
| - """ |
145 |
| - # https://stackoverflow.com/a/65114346/295606 |
146 |
| - email = verify_password_reset_token(payload["validation"]) |
147 |
| - if not email or current_user.email != email: |
148 |
| - raise HTTPException( |
149 |
| - status_code=400, |
150 |
| - detail="Invalid token", |
151 |
| - ) |
152 |
| - crud.user.validate_email(db=db, db_obj=current_user) |
153 |
| - return {"msg": "Email address validated successfully."} |
154 |
| - |
155 |
| - |
156 | 113 | @router.post("/toggle-state", response_model=schemas.Msg)
|
157 | 114 | def toggle_state(
|
158 | 115 | *,
|
|
0 commit comments