Browse Source

refactor(request): fix typo in big corp name

gudvinr 8 months ago
parent
commit
5e3bba9ae1

+ 1 - 1
internal/googlereader/handler.go

@@ -230,7 +230,7 @@ func (h *handler) tokenHandler(w http.ResponseWriter, r *http.Request) {
 		return
 	}
 
-	token := request.GoolgeReaderToken(r)
+	token := request.GoogleReaderToken(r)
 	if token == "" {
 		slog.Warn("[GoogleReader] User does not have token",
 			slog.String("client_ip", clientIP),

+ 1 - 1
internal/googlereader/middleware.go

@@ -181,7 +181,7 @@ func (m *middleware) apiKeyAuth(next http.Handler) http.Handler {
 		ctx = context.WithValue(ctx, request.UserTimezoneContextKey, user.Timezone)
 		ctx = context.WithValue(ctx, request.IsAdminUserContextKey, user.IsAdmin)
 		ctx = context.WithValue(ctx, request.IsAuthenticatedContextKey, true)
-		ctx = context.WithValue(ctx, request.GoogleReaderToken, token)
+		ctx = context.WithValue(ctx, request.GoogleReaderTokenKey, token)
 
 		next.ServeHTTP(w, r.WithContext(ctx))
 	})

+ 4 - 4
internal/http/request/context.go

@@ -31,7 +31,7 @@ const (
 	FlashErrorMessageContextKey
 	LastForceRefreshContextKey
 	ClientIPContextKey
-	GoogleReaderToken
+	GoogleReaderTokenKey
 	WebAuthnDataContextKey
 )
 
@@ -44,9 +44,9 @@ func WebAuthnSessionData(r *http.Request) *model.WebAuthnSession {
 	return nil
 }
 
-// GoolgeReaderToken returns the google reader token if it exists.
-func GoolgeReaderToken(r *http.Request) string {
-	return getContextStringValue(r, GoogleReaderToken)
+// GoogleReaderToken returns the google reader token if it exists.
+func GoogleReaderToken(r *http.Request) string {
+	return getContextStringValue(r, GoogleReaderTokenKey)
 }
 
 // IsAdminUser checks if the logged user is administrator.