Explorar o código

fix: Unauthenticated page access redirect does not remove query from url

Owen Diffey %!s(int64=3) %!d(string=hai) anos
pai
achega
76fadd3aec
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      frontend/src/main.js

+ 3 - 3
frontend/src/main.js

@@ -176,14 +176,14 @@ router.beforeEach((to, from, next) => {
 	if (to.meta.loginRequired || to.meta.adminRequired || to.meta.guestsOnly) {
 		const gotData = () => {
 			if (to.meta.loginRequired && !store.state.user.auth.loggedIn)
-				next({ path: "/login" });
+				next({ path: "/login", query: "" });
 			else if (
 				to.meta.adminRequired &&
 				store.state.user.auth.role !== "admin"
 			)
-				next({ path: "/" });
+				next({ path: "/", query: "" });
 			else if (to.meta.guestsOnly && store.state.user.auth.loggedIn)
-				next({ path: "/" });
+				next({ path: "/", query: "" });
 			else next();
 		};