Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Sep 26, 2024
1 parent 4fef000 commit 7bb3da5
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default defineAppConfig({
title: 'Table of Contents',
bottom: {
title: 'Community',
edit: 'https://github.com/nuxt-ui-pro/docs/edit/main/content',
edit: 'https://github.com/nuxt-modules/strapi/edit/main/docs/content',
links: [{
icon: 'i-heroicons-star',
label: 'Star on GitHub',
Expand Down
2 changes: 1 addition & 1 deletion docs/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import type { ParsedContent } from '@nuxt/content'
const { data: navigation } = await useAsyncData('navigation', () => fetchContentNavigation())
const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', {
Expand Down
2 changes: 1 addition & 1 deletion docs/components/TheHeader.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { NavItem } from '@nuxt/content'
const navigation = inject<NavItem[]>('navigation', [])
Expand Down
2 changes: 1 addition & 1 deletion docs/error.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import type { ParsedContent } from '@nuxt/content'
import type { NuxtError } from '#app'
useSeoMeta({
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/docs.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { NavItem } from '@nuxt/content'
const navigation = inject<Ref<NavItem[]>>('navigation')
</script>
Expand Down
15 changes: 12 additions & 3 deletions docs/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
extends: ['@nuxt/ui-pro'],

modules: [
'@nuxt/content',
'@nuxt/ui',
'@nuxt/fonts',
'@nuxtjs/plausible',
'nuxt-og-image'
],
ui: {
icons: ['heroicons', 'simple-icons']

icon: {
clientBundle: {
scan: true
}
},

routeRules: {
'/api/search.json': { prerender: true }
},

// Devtools / Typescript
devtools: { enabled: true },
typescript: { strict: false }

typescript: { strict: false },

compatibilityDate: '2024-09-26'
})
2 changes: 1 addition & 1 deletion playground/pages/auth/[provider]/callback.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</template>

<script setup lang="ts">
import type { StrapiAuthProvider } from '@nuxtjs/strapi/dist/runtime/types'
import type { StrapiAuthProvider } from '@nuxtjs/strapi'
const { authenticateProvider } = useStrapiAuth()
const route = useRoute()
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/useStrapiAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const useStrapiAuth = () => {
if (token.value) {
try {
user.value = await client('/users/me', { params: config.strapi.auth })
} catch (e) {
} catch {
setToken(null)
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/runtime/composables/useStrapiToken.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { Ref } from 'vue'
import { useCookie, useNuxtApp, useRuntimeConfig } from '#imports'

export const useStrapiToken = () => {
export const useStrapiToken = (): Ref<string | null> => {
const nuxt = useNuxtApp()
const config = import.meta.server ? useRuntimeConfig() : useRuntimeConfig().public

nuxt._cookies = nuxt._cookies || {}
if (nuxt._cookies[config.strapi.cookieName]) {
return nuxt._cookies[config.strapi.cookieName]
return nuxt._cookies[config.strapi.cookieName] as Ref<string>
}

const cookie = useCookie<string | null>(config.strapi.cookieName, config.strapi.cookie)
Expand Down

0 comments on commit 7bb3da5

Please sign in to comment.