mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-26 15:54:20 -04:00
fix: pwa share target (#5557)
This commit is contained in:
10
frontend/middleware/pwa-share-target-redirect.global.ts
Normal file
10
frontend/middleware/pwa-share-target-redirect.global.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
if (to.path === "/r/create/url") {
|
||||
const { user } = useMealieAuth();
|
||||
const groupSlug = user.value?.groupSlug;
|
||||
if (!groupSlug) {
|
||||
return navigateTo("/login", { redirectCode: 301 });
|
||||
}
|
||||
return navigateTo(`/g/${groupSlug}${to.fullPath}`, { redirectCode: 301 });
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user