Skip to content

Conversation

@bgrgicak
Copy link
Collaborator

@bgrgicak bgrgicak commented Nov 6, 2025

Motivation for the change, related issues

As reported in #2872 the Playground website will override the login step and shorthand when applying Query API overrides.

The default behavior of the Query API is to set the login shorthand to true, but the override doesn't check if the Blueprint already provides a login step or shorthand. This behavior results in the user being unable to use the login step and shorthand on the Playground website, except if they explicitly set ?login=no in the Query API.

This PR addresses the issue by checking if the Blueprint contains a login step or shorthand, and only applies the default login override if the Blueprint doesn't contain a login step and shorthand.

Testing Instructions (or ideally a Blueprint)

@bgrgicak bgrgicak requested a review from Copilot November 6, 2025 06:17
@bgrgicak bgrgicak self-assigned this Nov 6, 2025
@bgrgicak bgrgicak added [Type] Bug An existing feature does not function as intended [Aspect] Website [Package][@wp-playground] Website labels Nov 6, 2025
@bgrgicak bgrgicak linked an issue Nov 6, 2025 that may be closed by this pull request
Copy link
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 prevents the login query parameter from overriding login configurations that are already defined in a blueprint. The change adds logic to check for existing login configurations before applying the query parameter default.

  • Adds detection for existing login steps in the blueprint's steps array
  • Adds detection for existing login shorthand in the blueprint object
  • Only applies the login=true default when neither form of login is already present

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

@bgrgicak bgrgicak marked this pull request as ready for review November 6, 2025 06:42
@bgrgicak bgrgicak requested a review from a team November 6, 2025 06:42
@adamziel
Copy link
Collaborator

adamziel commented Nov 6, 2025

This means explicitly specifying login=yes won't override the Blueprint value. Let's do it a bit differently and only override if the query parameter was explicitly provided.

@bgrgicak
Copy link
Collaborator Author

bgrgicak commented Nov 6, 2025

This means explicitly specifying login=yes won't override the Blueprint value. Let's do it a bit differently and only override if the query parameter was explicitly provided.

I implemented it in 5834f58, but I'm not sure that this is the best solution.

My concern is this scenario. The Blueprints says login as Demo and the Query API says login. I would expect that _login as Demo_ + _login_ = _login as Demo_, but now it results in _login as admin_.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Aspect] Website [Package][@wp-playground] Website [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Login with a different user doesn't seem to work

3 participants