aboutsummaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-13 20:57:08 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-13 20:57:08 -0400
commit1d8793f4f84fd5c88dd36eedb83e0c06c24f7477 (patch)
treefe490267a4e4b8bbe9fbbe10f7ac06f219fc04dc /web.go
parenta64a435757ab96cdd73ae83903242406bbb258f8 (diff)
downloadlastfm-api-1d8793f4f84fd5c88dd36eedb83e0c06c24f7477.tar.gz
Fix the fix of password bug
Diffstat (limited to 'web.go')
-rw-r--r--web.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/web.go b/web.go
index 0810f76..31a8317 100644
--- a/web.go
+++ b/web.go
@@ -106,11 +106,13 @@ func (app *App) settings(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
u := &User{
- Id: se.UserId,
- Name: r.FormValue("name"),
- Email: r.FormValue("email"),
- LfmName: r.FormValue("lfm_name"),
- LfmPassword: md5hex(r.FormValue("lfm_password")),
+ Id: se.UserId,
+ Name: r.FormValue("name"),
+ Email: r.FormValue("email"),
+ LfmName: r.FormValue("lfm_name"),
+ }
+ if password := r.FormValue("lfm_password"); password != "" {
+ u.LfmPassword = md5hex(password)
}
if err := app.SaveUser(u); err != nil {
log.Println(err)