Skip to content

Replaced AuthorizeAttribute check with ApiGroupAttribute in IsApiFrontAuthenticated() to determine API group membership.#688

Open
Taraweesh wants to merge 1 commit intograndnode:developfrom
Taraweesh:fix-frontend-authintication-always-fails
Open

Replaced AuthorizeAttribute check with ApiGroupAttribute in IsApiFrontAuthenticated() to determine API group membership.#688
Taraweesh wants to merge 1 commit intograndnode:developfrom
Taraweesh:fix-frontend-authintication-always-fails

Conversation

@Taraweesh
Copy link
Copy Markdown

Replaced AuthorizeAttribute check with ApiGroupAttribute in IsApiFrontAuthenticated() to determine API group membership.#678

…tAuthenticated() to determine API group membership.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes frontend customer resolution in ApiAuthenticationService by identifying storefront API requests through the codebase’s v2 API-group metadata instead of relying on AuthorizeAttribute, which does not represent the affected frontend endpoints.

Changes:

  • Replaced the frontend API detection logic in IsApiFrontAuthenticated() to look for ApiGroupAttribute with the v2 group name.
  • Added the shared-kernel imports needed to read API-group metadata and constants.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +66 to +67
var apiGroupAttr = endpoint.Metadata.GetOrderedMetadata<ApiGroupAttribute>();
return apiGroupAttr.Any(attr => attr.GroupName == ApiConstants.ApiGroupNameV2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants