Skip to content

Commit

Permalink
refactor(frontend): update acceptable paths in route middleware
Browse files Browse the repository at this point in the history
Adjust the acceptable paths in the route middleware to use route names instead of paths for improved readability and maintainability.
  • Loading branch information
sajjadth committed Nov 25, 2023
1 parent 447a339 commit a5953ae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/middleware/setup.global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ async function checkBackendStatus() {
export default defineNuxtRouteMiddleware(async (to, from) => {
// check for acceptable paths
const isPathInAcceptablePaths =
to.path === "/app" ||
to.path === "/account/profile" ||
to.path === "/account/password/update";
to.name === "app" ||
to.name === "account-profile" ||
to.name === "account-password-update";

// Access the main store
const store = useMainStore();
Expand Down

0 comments on commit a5953ae

Please sign in to comment.