mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-05-12 13:03:31 -04:00
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:
@@ -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 });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user