fix: make PWA share target functional on Android Chrome (#7468)

Co-authored-by: Zdenek <tvuj-email@example.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Zdenek Stursa
2026-05-10 20:21:16 +02:00
committed by GitHub
parent 9fd3fbca8b
commit 8c06f49b02
4 changed files with 68 additions and 15 deletions

View File

@@ -3,8 +3,11 @@ export default defineNuxtRouteMiddleware((to) => {
const { user } = useMealieAuth();
const groupSlug = user.value?.groupSlug;
if (!groupSlug) {
return navigateTo("/login", { redirectCode: 301 });
// Preserve the full path (including recipe_import_url query param) so the
// login page can redirect back here after successful authentication.
const redirect = encodeURIComponent(to.fullPath);
return navigateTo(`/login?redirect=${redirect}`, { redirectCode: 302 });
}
return navigateTo(`/g/${groupSlug}${to.fullPath}`, { redirectCode: 301 });
return navigateTo(`/g/${groupSlug}${to.fullPath}`, { redirectCode: 302 });
}
});