Skip to content

Commit

Permalink
fix(demo): upgrade to 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
larbish committed Aug 2, 2023
1 parent 00f8cc4 commit 10e0586
Show file tree
Hide file tree
Showing 9 changed files with 754 additions and 690 deletions.
2 changes: 1 addition & 1 deletion demo/components/AppHeader.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
const client = useSupabaseAuthClient()
const client = useSupabaseClient()
const user = useSupabaseUser()
const colorMode = useColorMode()
Expand Down
7 changes: 0 additions & 7 deletions demo/middleware/auth.ts

This file was deleted.

11 changes: 11 additions & 0 deletions demo/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ export default defineNuxtConfig({
// https://github.com/nuxt-modules/color-mode
'@nuxtjs/color-mode'
],
runtimeConfig: {
public: {
baseUrl: process.env.BASE_URL || 'http://localhost:3000'
},
},
ui: {
colors: {
primary: 'green'
},
icons: ['mdi', 'heroicons', 'heroicons-outline']
},
supabase: {
redirectOptions: {
login: '/',
callback: '/confirm'
},
}
})
14 changes: 7 additions & 7 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
"lint": "eslint ."
},
"devDependencies": {
"@iconify-json/heroicons": "^1.1.10",
"@iconify-json/heroicons": "^1.1.11",
"@iconify-json/heroicons-outline": "^1.1.6",
"@iconify-json/mdi": "^1.1.52",
"@iconify-json/mdi": "^1.1.53",
"@nuxt/eslint-config": "^0.1.1",
"@nuxthq/ui": "^1.2.10",
"@nuxtjs/color-mode": "^3.2.0",
"@nuxtjs/supabase": "^0.3.6-0",
"eslint": "^8.41.0",
"nuxt": "^3.5.2",
"typescript": "^5.1.3"
"@nuxtjs/color-mode": "^3.3.0",
"@nuxtjs/supabase": "^1.0.0-0",
"eslint": "^8.46.0",
"nuxt": "^3.6.5",
"typescript": "^5.1.6"
},
"resolutions": {
"consola": "^3.0.0"
Expand Down
17 changes: 17 additions & 0 deletions demo/pages/confirm.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script setup lang="ts">
const user = useSupabaseUser()
watch(user, () => {
if (user.value) {
return navigateTo('/tasks')
}
}, { immediate: true })
</script>

<template>
<div>
<p class="u-text-black">
Redirecting...
</p>
</div>
</template>
6 changes: 4 additions & 2 deletions demo/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<script setup lang="ts">
const user = useSupabaseUser()
const { auth } = useSupabaseAuthClient()
const { auth } = useSupabaseClient()
const redirectTo = `${useRuntimeConfig().public.baseUrl}/confirm`
watchEffect(() => {
if (user.value) {
Expand All @@ -21,7 +23,7 @@ watchEffect(() => {
block
label="Github"
variant="black"
@click="auth.signInWithOAuth({ provider: 'github' })"
@click="auth.signInWithOAuth({ provider: 'github', options: { redirectTo } })"
/>
</LoginCard>
</div>
Expand Down
4 changes: 0 additions & 4 deletions demo/pages/tasks.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<script setup lang="ts">
import { Database } from '~~/types/database.types'
definePageMeta({
middleware: 'auth'
})
const client = useSupabaseClient<Database>()
const user = useSupabaseUser()
Expand Down
Loading

0 comments on commit 10e0586

Please sign in to comment.