aboutsummaryrefslogtreecommitdiffhomepage
path: root/middleware/fever.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/fever.go')
-rw-r--r--middleware/fever.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/middleware/fever.go b/middleware/fever.go
index 3fdbcfd..9addf7e 100644
--- a/middleware/fever.go
+++ b/middleware/fever.go
@@ -8,6 +8,7 @@ import (
"context"
"net/http"
+ "miniflux.app/http/request"
"miniflux.app/http/response/json"
"miniflux.app/logger"
)
@@ -34,10 +35,10 @@ func (m *Middleware) FeverAuth(next http.Handler) http.Handler {
m.store.SetLastLogin(user.ID)
ctx := r.Context()
- ctx = context.WithValue(ctx, UserIDContextKey, user.ID)
- ctx = context.WithValue(ctx, UserTimezoneContextKey, user.Timezone)
- ctx = context.WithValue(ctx, IsAdminUserContextKey, user.IsAdmin)
- ctx = context.WithValue(ctx, IsAuthenticatedContextKey, true)
+ ctx = context.WithValue(ctx, request.UserIDContextKey, user.ID)
+ ctx = context.WithValue(ctx, request.UserTimezoneContextKey, user.Timezone)
+ ctx = context.WithValue(ctx, request.IsAdminUserContextKey, user.IsAdmin)
+ ctx = context.WithValue(ctx, request.IsAuthenticatedContextKey, true)
next.ServeHTTP(w, r.WithContext(ctx))
})