refactor authenticate to use Token.

This commit is contained in:
Miroslav Šedivý 2021-03-13 20:42:56 +01:00
parent 6b638db825
commit 58b00525cc
4 changed files with 27 additions and 38 deletions

View file

@ -59,7 +59,7 @@ func (api *ApiManagerCtx) Route(r chi.Router) {
func (api *ApiManagerCtx) Authenticate(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session, err := api.sessions.AuthenticateRequest(r)
session, err := api.sessions.Authenticate(r)
if err != nil {
utils.HttpUnauthorized(w, err)
} else {