# HG changeset patch # User Sascha L. Teichmann # Date 1532605658 -7200 # Node ID 694f959ba3e709844489d6628109d928b055edd0 # Parent 8a226dc1c6ff244cf8fc31945386b5ff8199828f Fixed bad route to /logout controller. Renamed controllers.token to controllers.login because this is what it does. diff -r 8a226dc1c6ff -r 694f959ba3e7 controllers/routes.go --- a/controllers/routes.go Thu Jul 26 13:39:59 2018 +0200 +++ b/controllers/routes.go Thu Jul 26 13:47:38 2018 +0200 @@ -16,9 +16,9 @@ api.Handle("/users", sysAdmin(createUser)).Methods(http.MethodPost) - api.HandleFunc("/login", token). + api.HandleFunc("/login", login). Methods(http.MethodGet, http.MethodPost) - api.Handle("/logout", auth.SessionMiddleware(http.HandlerFunc(token))). + api.Handle("/logout", auth.SessionMiddleware(http.HandlerFunc(logout))). Methods(http.MethodGet, http.MethodPost) api.Handle("/renew", auth.SessionMiddleware(http.HandlerFunc(renew))). Methods(http.MethodGet, http.MethodPost) diff -r 8a226dc1c6ff -r 694f959ba3e7 controllers/token.go --- a/controllers/token.go Thu Jul 26 13:39:59 2018 +0200 +++ b/controllers/token.go Thu Jul 26 13:47:38 2018 +0200 @@ -52,7 +52,7 @@ fmt.Fprintln(rw, "token deleted") } -func token(rw http.ResponseWriter, req *http.Request) { +func login(rw http.ResponseWriter, req *http.Request) { user := req.FormValue("user") password := req.FormValue("password")