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
Is there a way to avoid having to do $session = response for updating the session after a user logs in? You can't return a 3xx status with a location header from your endpoint since you have to pass the data to update the session.
// index.js// ...return{status: 200,body: { user }}
<!-- index.svelte --><scriptcontext="module">exportasyncfunctionload({ session }){if(session.user){return{status: 302,redirect: '/',}}return{}}</script><script>import{session}from'$app/stores'asyncfunctionlogin(){// ...// is there another way to rerun the `load` function so// you can return a redirect instead?$session.user=response.user}</script>
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hey! 👋
Is there a way to avoid having to do
$session = response
for updating the session after a user logs in? You can't return a3xx
status with alocation
header from your endpoint since you have to pass the data to update thesession
.Beta Was this translation helpful? Give feedback.
All reactions