comparison pkg/controllers/routes.go @ 484:2ac37419f593

Implemented wamos/issue114 (Improve code consistency: For login use json body, disallow GET).
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 24 Aug 2018 11:36:11 +0200
parents 11d80120ed3d
children b2dc9c2f69e0
comparison
equal deleted inserted replaced
483:27502291e564 484:2ac37419f593
94 Handle: published, 94 Handle: published,
95 })).Methods(http.MethodGet) 95 })).Methods(http.MethodGet)
96 96
97 // Token handling: Login/Logout. 97 // Token handling: Login/Logout.
98 api.HandleFunc("/login", login). 98 api.HandleFunc("/login", login).
99 Methods(http.MethodGet, http.MethodPost) 99 Methods(http.MethodPost)
100 api.Handle("/logout", auth.SessionMiddleware(http.HandlerFunc(logout))). 100 api.Handle("/logout", auth.SessionMiddleware(http.HandlerFunc(logout))).
101 Methods(http.MethodGet, http.MethodPost) 101 Methods(http.MethodGet, http.MethodPost)
102 api.Handle("/renew", auth.SessionMiddleware(http.HandlerFunc(renew))). 102 api.Handle("/renew", auth.SessionMiddleware(http.HandlerFunc(renew))).
103 Methods(http.MethodGet, http.MethodPost) 103 Methods(http.MethodGet, http.MethodPost)
104 } 104 }