Skip to content

Hide Login Panel#2345

Draft
DariuszRozmus wants to merge 2 commits into
masterfrom
2318-remove-use-password-login-from-plgrid-instance
Draft

Hide Login Panel#2345
DariuszRozmus wants to merge 2 commits into
masterfrom
2318-remove-use-password-login-from-plgrid-instance

Conversation

@DariuszRozmus

Copy link
Copy Markdown

Fixes #2318

@DariuszRozmus DariuszRozmus self-assigned this Mar 23, 2026
@grzanka

grzanka commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

That is not correct. Demo mode is used for deployment to yaptide.github.io and yaptide.github.io/web_dev.
Normal mode is used for deployment to https://yap-dev.c3.plgrid.pl/ and https://yaptide.c3.plgrid.pl/

I would like to get rid of user and password from all four of this sites, but keep the possibility to enable it when working locally.

That can be achieved by defining new env variable with reasonable mode which would control whether user+password mode is displayed or not.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes/hides the “use password login” option on the login screen for the PLGrid (alt auth) flow, addressing Issue #2318.

Changes:

  • Read demoMode from config in LoginPanel.
  • Add showPasswordLogin flag and render the “use password login” link conditionally.

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

if (initialized && !keycloak.authenticated) keycloak.login();
}, [initialized, keycloak]);

const showPasswordLogin = !altAuth && !demoMode;

Copilot AI Mar 24, 2026

Copy link

Choose a reason for hiding this comment

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

showPasswordLogin is computed as !altAuth && !demoMode, but the link is rendered only inside the altAuth && !namePasswordLogin branch. When altAuth is true, this condition is always false, so the password-login fallback becomes unreachable (and NamePasswordLoginPanel can no longer be reached when altAuth is enabled). Adjust the condition to match the intended behavior (e.g., gate on altAuth and the specific environment/instance you want to disable it for, rather than !altAuth).

Suggested change
const showPasswordLogin = !altAuth && !demoMode;
const showPasswordLogin = altAuth && !demoMode;

Copilot uses AI. Check for mistakes.
@grzanka

grzanka commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

@DariuszRozmus find some better title for the PR as well

@DariuszRozmus DariuszRozmus changed the title first draft Hide Login Panel Mar 31, 2026
const BACKEND_URL = process.env.REACT_APP_BACKEND_URL ?? 'http://localhost:5000';
const DEMO_MODE = process.env.REACT_APP_TARGET === 'demo';
const ALT_AUTH = process.env.REACT_APP_ALT_AUTH === 'plg';
const USE_BASIC_AUTH = process.env.REACT_APP_USE_BASIC_AUTH === 'true';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what do you mean by "basic auth" ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

take a look at the discussion here:
https://gist.github.com/grzanka/4c71da7a1794c2c109f2d51f3d0189aa

you could use this PR for a more general cleaning

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.

Remove "use password login" from plgrid instance

3 participants