removed hardcoded auth url from client
This commit is contained in:
@@ -37,6 +37,9 @@ const router = createRouter({
|
||||
]
|
||||
})
|
||||
|
||||
const addr = import.meta.env.VITE_APIHOST;
|
||||
|
||||
|
||||
router.beforeEach(async (to) => {
|
||||
const user = useUserStore()
|
||||
|
||||
@@ -49,7 +52,7 @@ router.beforeEach(async (to) => {
|
||||
if (to.meta.requiresAuth && !user.isLoggedIn) {
|
||||
// Redirect back to original page after login
|
||||
const redirectUrl = encodeURIComponent(window.location.origin + to.fullPath)
|
||||
window.location.href = `https://aj17thdevapi.nexuszone.net/login?redirect=${redirectUrl}`
|
||||
window.location.href = `${addr}/login?redirect=${redirectUrl}`
|
||||
return false // Prevent Vue Router from continuing
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user