aboutsummaryrefslogtreecommitdiffstats
path: root/web.go
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2017-06-10 19:21:54 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2017-06-10 19:21:54 -0400
commit246ce98dc8a7a55c6a9dfb850afcc69c7c8ea4f8 (patch)
treeaff48491487d8cf58e2f955f403d616a9aa7bcaf /web.go
parent3d28f3c83dabe6049d8d189c29483ed8afcd6641 (diff)
downloadlastfm-api-246ce98dc8a7a55c6a9dfb850afcc69c7c8ea4f8.tar.gz
do not ignore error
Diffstat (limited to 'web.go')
-rw-r--r--web.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/web.go b/web.go
index 032e04a..43d3c9f 100644
--- a/web.go
+++ b/web.go
@@ -26,7 +26,9 @@ type UserSession struct {
func (app *App) login(w http.ResponseWriter, r *http.Request) {
state := hex.EncodeToString(genKey(32))
- app.SetCookie(w, "state", state, 120)
+ if err := app.SetCookie(w, "state", state, 120); err != nil {
+ log.Panic(err)
+ }
url := app.Config.OAuth.AuthCodeURL(state)
app.Template.ExecuteTemplate(w, "login.tmpl", url)
}