diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-06 19:20:09 -0400 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2017-06-06 19:20:09 -0400 |
| commit | 53841da448baa28067bab046198757954cebc4a1 (patch) | |
| tree | 514750df12d2391b77d55b124a8a044b0d4998b1 /apiv1.go | |
| parent | 81522cbae16c6aadb1b789f3f875dc50f10cc005 (diff) | |
| download | lastfm-api-53841da448baa28067bab046198757954cebc4a1.tar.gz | |
Use user_id instead of lfm_name as much as possible
Diffstat (limited to 'apiv1.go')
| -rw-r--r-- | apiv1.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -36,14 +36,14 @@ func (app *App) mainHandler(w http.ResponseWriter, r *http.Request) { user := r.FormValue("u") auth := r.FormValue("a") - password, err := app.GetPassword(user) + userId, password, err := app.GetUser(user) if (md5hex(password+timestamp) != auth) || err != nil { fmt.Fprintln(w, "BADAUTH") return } s := &Session{ - User: user, + UserId: userId, Client: r.FormValue("c"), ClientVersion: r.FormValue("v"), Key: randomToken(16), @@ -162,6 +162,7 @@ func parseScrobbles(values url.Values, session *Session) ([]Scrobble, int) { ignored++ } else { scrobble.Session = session.Key + scrobble.UserId = session.UserId scrobbles = append(scrobbles, scrobble) } } |
