Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#207 storeファイルを分割し、supabase関連の処理とログイン関連の処理をリファクタリングした #244

Merged
merged 8 commits into from
Aug 21, 2024
2 changes: 2 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
NUXT_HOST=localhost
NUXT_PORT=3001

NUXT_PUBLIC_BASE_URL=http://localhost:3001

NUXT_PUBLIC_SUPABASE_URL=http://localhost:54321
NUXT_PUBLIC_SUPABASE_KEY=
NUXT_PUBLIC_GTAG_APP_NAME=
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pnpm dev

```bash
supabase db diff -f [file_name]
supabase gen types --lang=typescript --local > database.types.ts
```

# Release
Expand Down
5 changes: 3 additions & 2 deletions app.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script setup lang="ts">
import { useAppStore } from '~/store/app'

const { isLoading } = storeToRefs(useAppStore())

const { $i18n } = useNuxtApp()
Expand All @@ -10,6 +8,9 @@ useSeoMeta({
title: $i18n.t(LOCALE_TITLE),
ogUrl: currentPath,
})

const { fetchUserData } = useUserStore()
fetchUserData()
</script>

<template>
Expand Down
26 changes: 26 additions & 0 deletions components/molecules/LogOut.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script setup lang="ts">
import { useSupabaseStore } from '~/store/supabase'

defineProps<{
isLogin: boolean,
}>()

const localePath = useLocalePath()
const { signOut } = useSupabaseStore()

const clickFn = async () => {
await signOut()
navigateTo(localePath('/'), { external: true })
}

</script>
<template>
<a
v-if="isLogin"
class="navbar-item"
exact-active-class="is-active"
@click="clickFn()"
>
{{ $t(LOCALE_AUTH_LOGOUT) }}
</a>
</template>
Loading
Loading