aboutsummaryrefslogtreecommitdiffstats
path: root/modern.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-04 19:30:25 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-04 19:30:25 -0400
commit81522cbae16c6aadb1b789f3f875dc50f10cc005 (patch)
treeab95db0a843783d4cfcd328e091a01597e241ee1 /modern.go
parentf154ae1ec88146017abf3de9d14d119facb5fc4c (diff)
downloadlastfm-api-81522cbae16c6aadb1b789f3f875dc50f10cc005.tar.gz
Clean up
Diffstat (limited to 'modern.go')
-rw-r--r--modern.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/modern.go b/modern.go
index 6277796..79bebd3 100644
--- a/modern.go
+++ b/modern.go
@@ -83,7 +83,12 @@ func (store *SqlStore) AuthGetSession(r *http.Request) ApiResponse {
var response struct {
Session *Session `json:"session"`
}
- session := NewSession("thibauthorel", r.FormValue("api_key"), "2.0")
+ session := &Session{
+ User: "thibauthorel",
+ Client: r.FormValue("api_key"),
+ Protocol: "2.0",
+ Key: randomToken(16),
+ }
store.PutSession(session)
response.Session = session
return response