docs: update vue client example (#1040)

* docs: update vue client example

* Update client.mdx
This commit is contained in:
reslear
2024-12-27 19:04:00 +01:00
committed by GitHub
parent 2ba021e8e3
commit ba153fdee9

View File

@@ -112,16 +112,20 @@ On top of normal methods, the client provides hooks to easily access different r
<Tab value="Vue">
```vue title="user.vue"
<script lang="ts" setup>
import { authClient } from '@/lib/auth-client'
const session = authClient.useSession()
</script>
<template>
<div>
<button v-if="!client.useSession().value" @click="() => client.signIn.social({
<button v-if="!session.data" @click="() => authClient.signIn.social({
provider: 'github'
})">
Continue with github
</button>
<div>
<pre>{{ client.useSession().value }}</pre>
<button v-if="client.useSession().value" @click="client.signOut()">
<pre>{{ session.data }}</pre>
<button v-if="session.data" @click="authClient.signOut()">
Sign out
</button>
</div>