diff --git a/frontend/src/plugins/router/middlewares/login.ts b/frontend/src/plugins/router/middlewares/login.ts index f7e1a0fe5e0..7e7bb98eb5c 100644 --- a/frontend/src/plugins/router/middlewares/login.ts +++ b/frontend/src/plugins/router/middlewares/login.ts @@ -24,6 +24,10 @@ export async function loginGuard( if (!isNil(remote.auth.currentServer) && !isNil(remote.auth.currentUser) && !isNil(remote.auth.currentUserToken) && routes.has(to.path)) { destinationRoute = { path: '/', replace: true }; + } else if (to.path === serverAddUrl && remote.auth.servers.length > 0 || to.path === serverSelectUrl) { + if (!jsonConfig.allowServerSelection) { + destinationRoute = { path: serverLoginUrl, replace: true }; + } } if (remote.auth.servers.length <= 0 && jsonConfig.defaultServerURLs.length <= 0) {