Skip to content

Commit 0caf5c1

Browse files
committed
fix(playgorund): watch on confirm page
1 parent 3fdd28b commit 0caf5c1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

playground/pages/confirm.vue

+6-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ if (process.server) {
55
'ERROR: It is very important to make sure that the redirect route right after login works without any server-side rendering. This is because the server-side rendering will not have the user data available. This is why we need to redirect to a client-side route right after login. This is a limitation of Supabase. If you are using Nuxt, you can use the no-ssr component to make sure that the redirect route is not server-side rendered.'
66
)
77
}
8+
89
const user = useSupabaseUser()
9-
if (user.value) {
10-
await navigateTo('/user')
11-
}
10+
watch(user, () => {
11+
if (user.value) {
12+
return navigateTo('/user')
13+
}
14+
}, { immediate: true })
1215
</script>
1316
<template>
1417
<div>Waiting for login...</div>

0 commit comments

Comments
 (0)