Skip to content

Commit

Permalink
feat(auth/const.ts): modify homePath to return root if VITE_APP_BASEN…
Browse files Browse the repository at this point in the history
…AME is root

The homePath now returns the root ("/") directly if the
VITE_APP_BASENAME is root. This change simplifies the path construction
and makes the code more readable and efficient.
  • Loading branch information
cybersiddhu committed Feb 12, 2024
1 parent c7f79f7 commit ea6394a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/auth/src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const callbackPath =
import.meta.env.VITE_APP_BASENAME === "/"
? "/callback"
: concatPath([import.meta.env.VITE_APP_BASENAME, "/callback"])
const homePath = concatPath([import.meta.env.VITE_APP_BASENAME, "/"])
const homePath =
import.meta.env.VITE_APP_BASENAME === "/"
? "/"
: concatPath([import.meta.env.VITE_APP_BASENAME, "/"])

export { callbackPath, homePath, type UserWithRoles }

0 comments on commit ea6394a

Please sign in to comment.