Skip to content

GetNotificationConfig and SaveNotificationConfig bypass middleware.GetUserID using raw c.Locals #7799

@aashu2006

Description

@aashu2006

User Request

Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 09a95aa8-ef9f-4185-b757-018a7284ba3a

Description

What happened:
In pkg/api/handlers/notifications.go:123 and 139, both handlers use c.Locals("userID") directly instead of middleware.GetUserID(c). Every other handler in the package uses the middleware abstraction. If the middleware key name ever changes, these silently return nil instead of failing at compile time.

What I expected:
Both handlers should use middleware.GetUserID(c) consistent with all other handlers in the package.

Steps to reproduce:

  1. Change the middleware userID key name
  2. Observe GetNotificationConfig and SaveNotificationConfig silently return nil userID

This issue was automatically created from the KubeStellar Console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-fix-requestedai-processingAI is currently processing this issuekind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions