Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Add updates in app/reference/docs/guides

dannykng0fc7846e87fa
diff --git a/apps/reference/docs/guides/with-nuxt-3.mdx b/apps/reference/docs/guides/with-nuxt-3.mdx
index c0eea3833b2..6f1768c9cd7 100644
--- a/apps/reference/docs/guides/with-nuxt-3.mdx
+++ b/apps/reference/docs/guides/with-nuxt-3.mdx
@@ -232,14 +232,6 @@ Let's set up a Vue component to manage logins and sign ups. We'll use Magic Link
</script>
```
-### User state
-
-To access the user information in other places, will create a user state. Create a new file called `states.ts` and utilize `useState` method of Nuxt 3.
-
-```typescript title="composables/states.ts"
-export const useUser = () => useState('user', () => null)
-```
-
### Account component
After a user is signed in we can allow them to edit their profile details and manage their account.
@@ -288,7 +280,7 @@ Let's create a new component for that called `Account.vue`.
loading.value = true
- const user = useUser();
+ const user = useSupabaseUser();
let { data } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
@@ -304,7 +296,7 @@ Let's create a new component for that called `Account.vue`.
async function updateProfile() {
try {
loading.value = true
- const user = useUser();
+ const user = useSupabaseUser();
const updates = {
id: user.value.id,
username: username.value,
@@ -342,32 +334,15 @@ Let's create a new component for that called `Account.vue`.
Now that we have all the components in place, let's update `app.vue`:
```html title="app.vue"
-<template>
- <div>
- <NuxtPage />
- </div>
-</template>
-```
-
-We now need to create an index page called `pages/index.vue`:
-
-```html title="pages/index.vue"
<template>
<div class="container" style="padding: 50px 0 100px 0">
- <Account v-if="user" />
- <Auth v-else />
+ <Account v-if="user" />
+ <Auth v-else />
</div>
</template>
<script setup>
- const supabase = useSupabaseClient()
-
- const user = useUser()
-
- user.value = useSupabaseUser()
- supabase.auth.onAuthStateChange((_, session) => {
- user.value = session?.user
- })
+const user = useSupabaseUser()
</script>
```
@@ -526,7 +501,7 @@ And then we can add the widget to the Account page:
loading.value = true
- const user = useUser();
+ const user = useSupabaseUser();
let { data } = await supabase
.from('profiles')
.select(`username, website, avatar_url`)
@@ -542,7 +517,7 @@ And then we can add the widget to the Account page:
async function updateProfile() {
try {
loading.value = true
- const user = useUser();
+ const user = useSupabaseUser();
const updates = {
id: user.value.id,
username: username.value,