Conversation
|
That is not correct. Demo mode is used for deployment to yaptide.github.io and yaptide.github.io/web_dev. 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. |
There was a problem hiding this comment.
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
demoModefrom config inLoginPanel. - Add
showPasswordLoginflag 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; |
There was a problem hiding this comment.
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).
| const showPasswordLogin = !altAuth && !demoMode; | |
| const showPasswordLogin = altAuth && !demoMode; |
|
@DariuszRozmus find some better title for the PR as well |
| 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'; |
There was a problem hiding this comment.
what do you mean by "basic auth" ?
There was a problem hiding this comment.
take a look at the discussion here:
https://gist.github.com/grzanka/4c71da7a1794c2c109f2d51f3d0189aa
you could use this PR for a more general cleaning
Fixes #2318