Compare commits

..

No commits in common. "9fc830a98b61ce082ea53c232873c3f5d9046a59" and "85fb966491fd0e3cf63a4b5df5ae6e163e9ef356" have entirely different histories.

8 changed files with 25 additions and 32 deletions

View File

@ -2,8 +2,5 @@ export default defineAppConfig({
ui: { ui: {
primary: 'sky', primary: 'sky',
gray: 'cool', gray: 'cool',
container: {
constrained: 'max-w-full',
},
}, },
}) })

BIN
bun.lockb

Binary file not shown.

View File

@ -1,12 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
const navigation = inject<Ref<NavItem[]>>('navigation')
const links = [{ const links = [{
label: 'Documentation', label: 'Documentation',
icon: 'i-heroicons-book-open', icon: 'i-heroicons-book-open',
to: 'https://ui.nuxt.com/getting-started', to: '/getting-started',
}, { }, {
label: 'Pro', label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d', icon: 'i-heroicons-square-3-stack-3d',
to: 'https://ui.nuxt.com/pro', to: '/pro',
}, { }, {
label: 'Releases', label: 'Releases',
icon: 'i-heroicons-rocket-launch', icon: 'i-heroicons-rocket-launch',
@ -23,11 +27,12 @@ const links = [{
<template #right> <template #right>
<UColorModeButton /> <UColorModeButton />
<UButton to="#" target="_blank" icon="i-heroicons-user-solid" color="gray" variant="ghost" />
<UButton to="https://github.com/nuxt/ui" target="_blank" icon="i-simple-icons-github" color="gray" variant="ghost" />
</template> </template>
<template #panel> <template #panel>
<UNavigationTree :links="links" /> <UNavigationTree :links="mapContentNavigation(navigation)" />
</template> </template>
</UHeader> </UHeader>
</template> </template>

View File

@ -6,19 +6,19 @@ const links = [
children: [ children: [
{ {
label: 'Overview', label: 'Overview',
to: '/login', to: '/partner/overview',
icon: 'i-heroicons-eye', icon: 'i-heroicons-eye',
}, },
{ {
label: 'Add Company', label: 'Add Company',
to: '/login', to: '/pro/components/docs/docs-search',
icon: 'i-heroicons-plus-circle', icon: 'i-heroicons-plus-circle',
}, },
], ],
}, },
{ {
label: 'People', label: 'People',
to: '/login', to: '/pro/components/docs/docs-search-button',
icon: 'i-heroicons-user-group', icon: 'i-heroicons-user-group',
}, },
] ]

View File

@ -1,12 +1,6 @@
export interface User { export interface User {
id: number
name: string name: string
email: string email?: string
email_verified_at: string | null
password?: string
remember_token?: string | null
created_at: string | null
updated_at: string | null
} }
export interface LoginCredentials { export interface LoginCredentials {

View File

@ -1,7 +1,9 @@
export default defineNuxtRouteMiddleware(() => { export default defineNuxtRouteMiddleware(() => {
const user = useUser() const user = useUser();
if (!user.value) { return navigateTo('/login') } if (!user.value) return navigateTo("/login");
if (user.value.email_verified_at) { return navigateTo('/') } // @ts-ignore
}) if (user.value.email_verified_at || user.value.is_verified)
return navigateTo("/");
});

View File

@ -14,6 +14,8 @@
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^1.1.0", "@antfu/eslint-config": "^1.1.0",
"@iconify-json/heroicons": "^1.1.13", "@iconify-json/heroicons": "^1.1.13",
"@iconify-json/logos": "^1.1.37",
"@iconify-json/simple-icons": "^1.1.76",
"@nuxt/devtools": "latest", "@nuxt/devtools": "latest",
"@nuxt/ui-pro": "^0.4.2", "@nuxt/ui-pro": "^0.4.2",
"eslint": "^8.53.0", "eslint": "^8.53.0",

View File

@ -9,7 +9,6 @@ export const $larafetch = $fetch.create({
async onRequest({ options }) { async onRequest({ options }) {
const { backendUrl, frontendUrl } = useRuntimeConfig().public const { backendUrl, frontendUrl } = useRuntimeConfig().public
const event = process.nitro ? useEvent() : null const event = process.nitro ? useEvent() : null
let token = event let token = event
? parseCookies(event)[CSRF_COOKIE] ? parseCookies(event)[CSRF_COOKIE]
: useCookie(CSRF_COOKIE).value : useCookie(CSRF_COOKIE).value
@ -47,23 +46,17 @@ export const $larafetch = $fetch.create({
}, },
async onResponseError({ response }) { async onResponseError({ response }) {
const status = response.status const status = response.status
if (status === 419) {
await initCsrf(true)
}
if ([500].includes(status)) { if ([500].includes(status)) {
console.error('[Laravel Error]', response.statusText, response._data) console.error('[Laravel Error]', response.statusText, response._data)
} }
}, },
}) })
async function initCsrf(forceRefresh = false) { async function initCsrf() {
const { backendUrl } = useRuntimeConfig().public const { backendUrl } = useRuntimeConfig().public
const existingToken = useCookie(CSRF_COOKIE).value const existingToken = useCookie(CSRF_COOKIE).value
if (existingToken && !forceRefresh) { if (existingToken) { return existingToken }
return existingToken
}
await $fetch('/sanctum/csrf-cookie', { await $fetch('/sanctum/csrf-cookie', {
baseURL: backendUrl, baseURL: backendUrl,