Password change

This commit is contained in:
Matthew Dillon 2015-10-12 20:43:59 -07:00
parent 0331834b92
commit e283ec7004
3 changed files with 34 additions and 0 deletions

View file

@ -259,3 +259,13 @@ func HandleUserLockout(w http.ResponseWriter, r *http.Request) *types.AppError {
fmt.Fprintln(w, `{}`)
return nil
}
func HandleUserPasswordChange(w http.ResponseWriter, r *http.Request) *types.AppError {
claims := helpers.GetClaims(r)
if err := models.UpdateUserPassword(claims.Sub, r.FormValue("password")); err != nil {
return newJSONError(err, http.StatusInternalServerError)
}
return nil
}