(app *App, u *User, newPass string)
| 644 | } |
| 645 | |
| 646 | func adminResetPassword(app *App, u *User, newPass string) error { |
| 647 | hashedPass, err := auth.HashPass([]byte(newPass)) |
| 648 | if err != nil { |
| 649 | return impart.HTTPError{http.StatusInternalServerError, fmt.Sprintf("Could not create password hash: %v", err)} |
| 650 | } |
| 651 | |
| 652 | err = app.db.ChangePassphrase(u.ID, true, "", hashedPass) |
| 653 | if err != nil { |
| 654 | return impart.HTTPError{http.StatusInternalServerError, fmt.Sprintf("Could not update passphrase: %v", err)} |
| 655 | } |
| 656 | return nil |
| 657 | } |
| 658 | |
| 659 | func handleViewAdminUpdates(app *App, u *User, w http.ResponseWriter, r *http.Request) error { |
| 660 | check := r.URL.Query().Get("check") |
no test coverage detected