mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-29 18:36:34 -05:00
docs: update vue client example (#1040)
* docs: update vue client example * Update client.mdx
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user