fix: /server/login with disabled server selection (#2504)
Some checks are pending
Push & Release 🌍 / Automation 🎛️ (push) Waiting to run
Push & Release 🌍 / ${{ github.event_name == 'push' && 'Unstable 🚀⚠️' || 'Stable 🏷️✅' }} (push) Waiting to run
Push & Release 🌍 / GitHub CodeQL 🔬 (push) Waiting to run
Push & Release 🌍 / Deploy 🚀 (push) Blocked by required conditions

Co-authored-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
hawken 2024-11-28 22:24:38 +01:00 committed by GitHub
parent 146c2a566a
commit 0607bf34a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,7 +41,11 @@ export const loginGuard = async (
): Promise<Exclude<NavigationGuardReturn, Error>> => {
const toServerPages = serverPages.has(to.name);
if (!jsonConfig.allowServerSelection && toServerPages) {
/**
* Do not allow the server selection pages if `allowServerSelection` is false in config.json,
* but do allow the login page.
*/
if (!jsonConfig.allowServerSelection && (toServerPages && to.name !== serverLoginUrl)) {
return false;
}