mirror of
https://github.com/rommapp/romm.git
synced 2026-11-30 10:32:57 +01:00
Merge pull request #3231 from rommapp/copilot/fix-registration-link-redirects
fix: registration links redirect to login for unauthenticated users
This commit is contained in:
@@ -74,6 +74,17 @@ api.interceptors.response.use(
|
||||
const params = new URLSearchParams(search);
|
||||
const fullPath = pathname + search;
|
||||
|
||||
// Don't redirect to login if already on an auth-exempt route
|
||||
const authExemptRoutes = [
|
||||
ROUTES.REGISTER,
|
||||
ROUTES.RESET_PASSWORD,
|
||||
ROUTES.PAIR,
|
||||
ROUTES.SETUP,
|
||||
];
|
||||
if (authExemptRoutes.some((route) => pathname.startsWith(`/${route}`))) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
|
||||
router.push({
|
||||
name: ROUTES.LOGIN,
|
||||
query: {
|
||||
|
||||
@@ -72,6 +72,9 @@ export default defineConfig(({ mode }) => {
|
||||
return {
|
||||
optimizeDeps: {
|
||||
include: VUETIFY_COMPONENTS,
|
||||
esbuildOptions: {
|
||||
target: "esnext",
|
||||
},
|
||||
},
|
||||
build: {
|
||||
target: "esnext",
|
||||
|
||||
Reference in New Issue
Block a user