(app *App, userID int64, newPass string)
| 1304 | } |
| 1305 | |
| 1306 | func doAutomatedPasswordChange(app *App, userID int64, newPass string) error { |
| 1307 | // Do password reset |
| 1308 | hashedPass, err := auth.HashPass([]byte(newPass)) |
| 1309 | if err != nil { |
| 1310 | return impart.HTTPError{http.StatusInternalServerError, "Could not create password hash."} |
| 1311 | } |
| 1312 | |
| 1313 | // Do update |
| 1314 | err = app.db.ChangePassphrase(userID, true, "", hashedPass) |
| 1315 | if err != nil { |
| 1316 | return err |
| 1317 | } |
| 1318 | return nil |
| 1319 | } |
| 1320 | |
| 1321 | func handleResetPasswordInit(app *App, w http.ResponseWriter, r *http.Request) error { |
| 1322 | returnLoc := impart.HTTPError{http.StatusFound, "/reset"} |
no test coverage detected