Skip to content

Commit 5260bf6

Browse files
committed
chore: better redirect in playground
1 parent ff7e9ec commit 5260bf6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/nuxt/playground/pages/authentication.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ const route = useRoute()
3232
const router = useRouter()
3333
3434
// automatically redirect the user if they are logged in but was rejected on the server because of an outdated cookie
35-
onMounted(async () => {
36-
const currentUser = await getCurrentUser()
35+
watch(user, (user) => {
3736
if (
38-
currentUser &&
37+
user &&
3938
route.query.redirect &&
4039
typeof route.query.redirect === 'string'
4140
) {

0 commit comments

Comments
 (0)