You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works great except that links with the data-sveltekit-preload-data option will also trigger this hook. This is fine but it's a bit weird in terms of UX that a user hovers a link and ends up in a login page.
Ideally I would like to know if the request was triggered by a preload so that this logic can be ignored... is there a way to accomplish this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an error hook that checks if there's been an auth error in which case the user is redirected to the login page:
This works great except that links with the
data-sveltekit-preload-data
option will also trigger this hook. This is fine but it's a bit weird in terms of UX that a user hovers a link and ends up in a login page.Ideally I would like to know if the request was triggered by a preload so that this logic can be ignored... is there a way to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions