Skip to content

Commit 0ba1554

Browse files
committed
2 parents c1d50f3 + 9e35c42 commit 0ba1554

File tree

9 files changed

+1715
-1380
lines changed

9 files changed

+1715
-1380
lines changed

apps/frontend/nuxt.config.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default defineNuxtConfig({
1717
'@vueuse/nuxt',
1818
'nuxt-og-image',
1919
'nuxt-site-config',
20+
'@nuxt/scripts',
2021
],
2122
css: ['~/assets/css/main.css'],
2223
app: {
@@ -47,13 +48,6 @@ export default defineNuxtConfig({
4748
},
4849
vite: {
4950
plugins: [tailwindcss()],
50-
server: {
51-
proxy: {
52-
'/api': 'http://localhost:8000',
53-
'/browse/sitemap.xml': 'http://localhost:8000',
54-
'/yay': 'https://blueprint.zip',
55-
},
56-
},
5751
optimizeDeps: {
5852
include: ['debug'],
5953
},
@@ -100,6 +94,11 @@ export default defineNuxtConfig({
10094
name: 'Blueprint',
10195
},
10296
nitro: {
97+
devProxy: {
98+
'/api': 'http://localhost:8000/api',
99+
'/browse/sitemap.xml': 'http://localhost:8000/browse/sitemap.xml',
100+
'/yay': 'https://blueprint.zip/yay',
101+
},
103102
routeRules: {
104103
'/api/**': {
105104
prerender: false,

apps/frontend/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@
1212
},
1313
"dependencies": {
1414
"@igorkowalczyk/is-browser": "^5.1.0",
15-
"@nuxt/content": "^3.7.1",
15+
"@nuxt/content": "^3.8.0",
1616
"@nuxt/fonts": "^0.11.4",
17-
"@nuxt/icon": "^2.0.0",
17+
"@nuxt/icon": "^2.1.0",
1818
"@nuxt/image": "^1.11.0",
1919
"@nuxt/scripts": "^0.12.2",
2020
"@nuxtjs/mdc": "^0.17.4",
2121
"@nuxtjs/plausible": "2.0.1",
2222
"@nuxtjs/sitemap": "^7.4.7",
2323
"@nuxtjs/turnstile": "1.1.1",
24-
"@tailwindcss/vite": "^4.1.14",
24+
"@tailwindcss/vite": "^4.1.16",
2525
"@types/file-saver": "^2.0.7",
26-
"@types/qrcode": "^1.5.5",
26+
"@types/qrcode": "^1.5.6",
2727
"@unhead/vue": "^2.0.19",
2828
"@vueuse/core": "^13.9.0",
2929
"@vueuse/nuxt": "^14.0.0",
3030
"better-sqlite3": "^12.4.1",
3131
"debug": "^4.4.3",
3232
"file-saver": "^2.0.5",
33-
"nuxt": "^4.1.2",
33+
"nuxt": "^4.2.0",
3434
"nuxt-marquee": "1.0.4",
3535
"nuxt-og-image": "5.1.12",
3636
"nuxt-site-config": "^3.2.11",
3737
"qrcode": "^1.5.4",
38-
"tailwindcss": "^4.1.14",
38+
"tailwindcss": "^4.1.16",
3939
"ufo": "^1.6.1",
40-
"unstorage": "^1.17.1",
40+
"unstorage": "^1.17.2",
4141
"vue": "^3.5.22",
42-
"vue-router": "^4.5.1"
42+
"vue-router": "^4.6.3"
4343
},
4444
"devDependencies": {
4545
"@iconify-json/lucide": "^1.2.71",

apps/frontend/pnpm-lock.yaml

Lines changed: 1637 additions & 1338 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/frontend/src/components/ui/app/user/Profile.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@
106106
<p class="mb-5">
107107
We need to know if you're human. Please complete the captcha below.
108108
</p>
109-
<div
110-
class="flex flex-col items-center rounded-2xl border border-neutral-700 bg-neutral-900 py-4"
111-
>
112-
<NuxtTurnstile v-model="accountForm.captcha" ref="turnstile" />
109+
<div class="rounded-2xl border border-neutral-700 bg-neutral-900 py-4">
110+
<div class="flex min-h-[65px] flex-col items-center">
111+
<NuxtTurnstile v-model="accountForm.captcha" ref="turnstile" />
112+
</div>
113113
</div>
114114
</template>
115115

apps/frontend/src/components/ui/app/user/Sessions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
:name="determineDeviceIcon(session.user_agent)"
6969
:size="18"
7070
/>
71-
<span>
71+
<span class="transition-all hover:blur-none md:blur-[6px]">
7272
{{ session.ip }}
7373
</span>
7474
</div>

apps/frontend/src/layouts/docs.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
</div>
3232
</client-only>
3333

34-
<client-only>
35-
<div class="flex">
36-
<div class="fixed z-50 flex md:static">
34+
<div class="flex">
35+
<div class="fixed z-50 flex md:static">
36+
<client-only>
3737
<div class="md:w-76">
3838
<Transition
3939
enter-active-class="transition-all duration-300 ease-out"
@@ -154,19 +154,19 @@
154154
</div>
155155
</Transition>
156156
</div>
157-
<div class="hidden md:block">
158-
<div
159-
class="bg-linear-to-b fixed h-full w-[1px] from-neutral-800 via-neutral-500 to-neutral-800"
160-
/>
161-
</div>
162-
</div>
163-
<div
164-
class="max-w-200 container space-y-12 overflow-hidden px-4 pb-12 pt-16 md:pt-12"
165-
>
166-
<slot />
157+
</client-only>
158+
<div class="hidden md:block">
159+
<div
160+
class="bg-linear-to-b fixed h-full w-[1px] from-neutral-800 via-neutral-500 to-neutral-800"
161+
/>
167162
</div>
168163
</div>
169-
</client-only>
164+
<div
165+
class="max-w-200 container space-y-12 overflow-hidden px-4 pb-12 pt-16 md:pt-12"
166+
>
167+
<slot />
168+
</div>
169+
</div>
170170

171171
<div
172172
class="fixed inset-0 top-0 -z-10 h-[50vh] w-full bg-[linear-gradient(to_right,var(--color-neutral-800)_1px,transparent_1px),linear-gradient(to_bottom,var(--color-neutral-800)_1px,transparent_1px)] bg-[size:30px_30px] bg-[position:-5px_-5px]"

apps/frontend/src/middleware/user.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default defineNuxtRouteMiddleware(async (to) => {
22
if (import.meta.server) return
33

4-
const { isAuthenticated, isFetched } = useAuth()
4+
const { user, isAuthenticated, isFetched } = useAuth()
55

66
if (!isFetched.value) {
77
await new Promise((resolve) => {
@@ -18,7 +18,8 @@ export default defineNuxtRouteMiddleware(async (to) => {
1818
})
1919
}
2020

21-
if (!isAuthenticated.value) {
21+
// isAuthenticated is a bit funky here
22+
if (!user?.value?.id) {
2223
return navigateTo('/auth')
2324
}
2425
})

apps/frontend/src/pages/auth/reset.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ definePageMeta({
7979
const route = useRoute()
8080
const { rules: validationRules } = useFormValidation()
8181
82-
if (!route.query.token || route.query.token.length != 96) {
83-
await navigateTo('/auth/forgot')
84-
}
82+
onMounted(async () => {
83+
if (!route.query.token || route.query.token.length != 96) {
84+
await navigateTo('/auth/forgot')
85+
}
86+
})
8587
8688
const loading = ref(false)
8789
const error = ref(false)

apps/frontend/src/pages/auth/verify.vue

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
<NuxtLink class="group outline-0" tabindex="0">
5656
<button
5757
:disabled="loading"
58-
@mousedown.prevent="handleResend"
58+
@mousedown.prevent
59+
@click="modalOpen.turnstile = true"
5960
type="button"
6061
tabindex="-1"
6162
class="text-default-font group-focus:text-brand-50 hover:text-brand-50 w-full cursor-pointer text-nowrap bg-neutral-950 px-4 py-3 text-left text-xl font-semibold transition-colors hover:bg-neutral-900 group-focus:bg-neutral-900 md:w-auto"
@@ -65,6 +66,33 @@
6566
</NuxtLink>
6667
</div>
6768
</form>
69+
70+
<ElementsModal
71+
:is-open="modalOpen.turnstile"
72+
:closable="true"
73+
title="Captcha"
74+
@close="modalOpen.turnstile = false"
75+
>
76+
<template #default>
77+
<p class="mb-5">
78+
We need to know if you're human. Please complete the captcha below.
79+
</p>
80+
<div class="rounded-2xl border border-neutral-700 bg-neutral-900 py-4">
81+
<div class="flex min-h-[65px] flex-col items-center">
82+
<NuxtTurnstile v-model="captchaToken" ref="turnstile" />
83+
</div>
84+
</div>
85+
</template>
86+
87+
<template #footer>
88+
<ElementsButton
89+
label="Continue"
90+
class="order-first w-full md:order-[unset] md:w-auto"
91+
:disabled="loading"
92+
@click="handleResend"
93+
/>
94+
</template>
95+
</ElementsModal>
6896
</template>
6997

7098
<script setup lang="ts">
@@ -76,12 +104,17 @@ definePageMeta({
76104
const { user, initializeAuth } = useAuth()
77105
const { rules: validationRules } = useFormValidation()
78106
107+
const turnstile = useTemplateRef('turnstile')
108+
const captchaToken = ref()
79109
const loading = ref(false)
110+
const fieldValidation = ref<Record<string, boolean>>({})
80111
const errors = ref({
81112
incorrect: false,
82113
resendError: false,
83114
})
84-
const fieldValidation = ref<Record<string, boolean>>({})
115+
const modalOpen = ref({
116+
turnstile: false,
117+
})
85118
const form = ref({
86119
token: '',
87120
})
@@ -120,9 +153,10 @@ const handleResend = async () => {
120153
method: 'PATCH',
121154
body: {
122155
email: user.value?.email_pending,
123-
captcha: null,
156+
captcha: captchaToken.value,
124157
},
125158
})
159+
modalOpen.value.turnstile = false
126160
} catch (error) {
127161
console.error(error)
128162
errors.value.resendError = true

0 commit comments

Comments
 (0)