1404/11/18-delete required rule in referral code &
hidden home page
This commit is contained in:
+3
-3
@@ -73,8 +73,8 @@ function goToLogin(to: RouteLocationNormalized, next: NavigationGuardNext) {
|
||||
}
|
||||
|
||||
function goToHome(to: RouteLocationNormalized, next: NavigationGuardNext) {
|
||||
if (to.name !== 'home') {
|
||||
return next({ name: 'home' }) // Redirect to login
|
||||
if (to.name !== 'buyProduct') {
|
||||
return next({ name: 'buyProduct' }) // Redirect to login
|
||||
} else {
|
||||
return next() // If already on the login page, don't redirect
|
||||
}
|
||||
@@ -151,7 +151,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
if (fingerPosition) {
|
||||
if (getToken()) {
|
||||
if (to.name === 'login') {
|
||||
return next({ name: from.name || 'home' }) // Redirect to home if trying to access login after authentication
|
||||
return next({ name: from.name || 'buyProduct' }) // Redirect to home if trying to access login after authentication
|
||||
}
|
||||
return next() // Proceed to the intended route
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user