(user: User)
| 226 | /** |
| 227 | * Finish a reset. |
| 228 | * |
| 229 | * Single use falls out of how the token is signed: the key includes the |
| 230 | * current password hash, so the moment this saves a new one every link |
| 231 | * issued against the old password stops verifying. Nothing to store, and |
| 232 | * nothing to clean up. |
| 233 | */ |
| 234 | async resetPassword( |
| 235 | token: string, |
| 236 | newPassword: string, |
| 237 | ): Promise<EmailConfirmationResponse> { |
| 238 | const bad = { |
| 239 | message: 'This reset link is invalid or has expired. Request a new one.', |
| 240 | success: false, |
| 241 | }; |
| 242 | |
| 243 | const parsed = parseResetToken(token); |
no outgoing calls
no test coverage detected