From ea6394a03e001087b4cd8e4af7a60d348929f36e Mon Sep 17 00:00:00 2001 From: Siddhartha Basu Date: Mon, 12 Feb 2024 15:32:40 -0600 Subject: [PATCH] feat(auth/const.ts): modify homePath to return root if VITE_APP_BASENAME 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. --- packages/auth/src/const.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/const.ts b/packages/auth/src/const.ts index c6e3498d9a..e2a1a2fec9 100644 --- a/packages/auth/src/const.ts +++ b/packages/auth/src/const.ts @@ -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 }