Skip to content

Commit

Permalink
fix(serverAdd): block server addition and selection when disallowed b…
Browse files Browse the repository at this point in the history
  • Loading branch information
Beat-YT authored Aug 9, 2024
1 parent 0de6181 commit b884466
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/plugins/router/middlewares/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b884466

Please sign in to comment.