@stacksjs/defaults 0.72.49 → 0.72.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/skills/stacks-browse/scripts/browse.ts +63 -4
- package/ide/vscode/package.json +1 -1
- package/lang/de.yml +0 -1
- package/package.json +7 -2
- package/resources/components/Dashboard/Auth/ForgotPasswordDashboard.stx +8 -0
- package/resources/components/Dashboard/Auth/Login.stx +8 -0
- package/resources/components/Dashboard/Auth/LoginDashboard.stx +5 -1
- package/resources/components/Dashboard/Auth/MagicLink.stx +94 -0
- package/resources/components/Dashboard/Auth/Register.stx +7 -0
- package/resources/components/Dashboard/Auth/RegisterDashboard.stx +5 -1
- package/resources/components/Dashboard/Auth/ResetPassword.stx +163 -0
- package/resources/components/Dashboard/Auth/ResetPasswordDashboard.stx +95 -0
- package/resources/layouts/403.stx +15 -148
- package/resources/layouts/404.stx +7 -2
- package/resources/views/auth/magic/[token].stx +24 -0
- package/resources/views/errors/404.stx +42 -0
- package/resources/views/forgot-password.stx +13 -0
- package/resources/views/login.stx +68 -0
- package/resources/views/password/reset/[token].stx +18 -0
- package/resources/views/register.stx +64 -0
- package/vcs/github/workflows/ci.yml +87 -0
- package/views/[...all].stx +0 -7
- package/views/about.md +0 -3
- package/views/auth/login.stx +0 -1
- package/views/auth/magic/[token].stx +0 -88
- package/views/auth/signup.stx +0 -120
- package/views/forum/category.stx +0 -92
- package/views/forum/index.stx +0 -209
- package/views/forum/new-topic.stx +0 -113
- package/views/forum/profile.stx +0 -1
- package/views/forum/topic.stx +0 -143
- package/views/hello-world/[name].stx +0 -47
- package/views/index.stx +0 -21
package/views/forum/topic.stx
DELETED
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
<script server>
|
|
2
|
-
const topicId = 0
|
|
3
|
-
</script>
|
|
4
|
-
<ForumLayout route="forum-topic">
|
|
5
|
-
<div class="grid gap-8 grid-cols-1 lg:grid-cols-3">
|
|
6
|
-
<div class="lg:col-span-2">
|
|
7
|
-
<ForumBreadcrumb :items="[
|
|
8
|
-
{ label: 'Forum', link: '/forum' },
|
|
9
|
-
{ label: 'Technical Support', link: '/forum/category/support/installation' },
|
|
10
|
-
{ label: 'How to implement authentication in a new Stacks.js project?', link: '/forum/topic/1' }
|
|
11
|
-
]" />
|
|
12
|
-
|
|
13
|
-
<ForumPost
|
|
14
|
-
id="1"
|
|
15
|
-
authorName="JohnDoe"
|
|
16
|
-
authorAvatar="/images/avatars/default.png"
|
|
17
|
-
createdAt="2 hours ago"
|
|
18
|
-
:likeCount="7"
|
|
19
|
-
isOriginalPost
|
|
20
|
-
title="How to implement authentication in a new Stacks.js project?"
|
|
21
|
-
>
|
|
22
|
-
<p>Hello everyone,</p>
|
|
23
|
-
<p>I'm trying to implement authentication in my new Stacks.js project but I'm having some issues with the middleware. Here's what I've tried so far:</p>
|
|
24
|
-
|
|
25
|
-
<pre class="my-4 p-4 bg-gray-100 rounded-md"><code>
|
|
26
|
-
// My authentication middleware
|
|
27
|
-
function authMiddleware(req, res, next) {
|
|
28
|
-
if (!req.session.user) {
|
|
29
|
-
return res.redirect('/login');
|
|
30
|
-
}
|
|
31
|
-
next();
|
|
32
|
-
}
|
|
33
|
-
</code></pre>
|
|
34
|
-
|
|
35
|
-
<p>But when I try to use this middleware, I get the following error:</p>
|
|
36
|
-
|
|
37
|
-
<blockquote class="my-4 pl-4 italic border-gray-300 border-l-4">
|
|
38
|
-
Error: req.session is undefined
|
|
39
|
-
</blockquote>
|
|
40
|
-
|
|
41
|
-
<p>Any help would be greatly appreciated! I'm using Stacks.js v1.8.2 with Express 4.18.0.</p>
|
|
42
|
-
</ForumPost>
|
|
43
|
-
|
|
44
|
-
<ForumPost
|
|
45
|
-
id="2"
|
|
46
|
-
authorName="ExpertUser"
|
|
47
|
-
authorAvatar="/images/avatars/default.png"
|
|
48
|
-
createdAt="1 hour ago"
|
|
49
|
-
:likeCount="3"
|
|
50
|
-
>
|
|
51
|
-
<p>Hi <a href="/forum/profile/johndoe" class="text-primary hover:underline">@JohnDoe</a>,</p>
|
|
52
|
-
<p>It looks like you haven't set up the session middleware correctly. You need to add it before your authentication middleware:</p>
|
|
53
|
-
|
|
54
|
-
<pre class="my-4 p-4 bg-gray-100 rounded-md"><code>
|
|
55
|
-
const session = require('express-session');
|
|
56
|
-
|
|
57
|
-
app.use(session({
|
|
58
|
-
secret: 'your-secret-key',
|
|
59
|
-
resave: false,
|
|
60
|
-
saveUninitialized: true,
|
|
61
|
-
cookie: { secure: process.env.NODE_ENV === 'production' }
|
|
62
|
-
}));
|
|
63
|
-
|
|
64
|
-
// Now your auth middleware will work
|
|
65
|
-
app.use(authMiddleware);
|
|
66
|
-
</code></pre>
|
|
67
|
-
|
|
68
|
-
<p>Also, make sure you've installed the express-session package:</p>
|
|
69
|
-
|
|
70
|
-
<pre class="my-4 p-4 bg-gray-100 rounded-md"><code>
|
|
71
|
-
npm install express-session
|
|
72
|
-
# or with bun
|
|
73
|
-
bun add express-session
|
|
74
|
-
</code></pre>
|
|
75
|
-
|
|
76
|
-
<p>Hope this helps!</p>
|
|
77
|
-
</ForumPost>
|
|
78
|
-
|
|
79
|
-
<ForumPost
|
|
80
|
-
id="3"
|
|
81
|
-
authorName="JohnDoe"
|
|
82
|
-
authorAvatar="/images/avatars/default.png"
|
|
83
|
-
createdAt="30 minutes ago"
|
|
84
|
-
:likeCount="2"
|
|
85
|
-
>
|
|
86
|
-
<p>Thank you so much, <a href="/forum/profile/expertuser" class="text-primary hover:underline">@ExpertUser</a>! That fixed my issue.</p>
|
|
87
|
-
<p>I completely forgot to set up the session middleware. Your solution works perfectly!</p>
|
|
88
|
-
<p>For anyone else who might run into this issue, I also had to install the express-session types for TypeScript:</p>
|
|
89
|
-
|
|
90
|
-
<pre class="my-4 p-4 bg-gray-100 rounded-md"><code>
|
|
91
|
-
npm install --save-dev @types/express-session
|
|
92
|
-
# or with bun
|
|
93
|
-
bun add -d @types/express-session
|
|
94
|
-
</code></pre>
|
|
95
|
-
</ForumPost>
|
|
96
|
-
|
|
97
|
-
<ForumReplyForm />
|
|
98
|
-
|
|
99
|
-
<ForumPagination :currentPage="1" :totalPages="1" />
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<div class="lg:col-span-1">
|
|
103
|
-
<ForumSidebar
|
|
104
|
-
:stats="{
|
|
105
|
-
topics: 540,
|
|
106
|
-
posts: 3287,
|
|
107
|
-
members: 1245,
|
|
108
|
-
newestMember: 'NewUser123'
|
|
109
|
-
}"
|
|
110
|
-
:popularTopics="[
|
|
111
|
-
{
|
|
112
|
-
id: 1,
|
|
113
|
-
title: 'How to implement authentication in a new Stacks.js project?',
|
|
114
|
-
link: '/forum/topic/1',
|
|
115
|
-
replyCount: 3,
|
|
116
|
-
viewCount: 45
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: 2,
|
|
120
|
-
title: 'Best practices for database migrations in Stacks.js',
|
|
121
|
-
link: '/forum/topic/3',
|
|
122
|
-
replyCount: 15,
|
|
123
|
-
viewCount: 128
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 3,
|
|
127
|
-
title: 'Introducing myself to the community!',
|
|
128
|
-
link: '/forum/topic/2',
|
|
129
|
-
replyCount: 8,
|
|
130
|
-
viewCount: 32
|
|
131
|
-
}
|
|
132
|
-
]"
|
|
133
|
-
:onlineUsers="[
|
|
134
|
-
{ id: 1, name: 'JohnDoe', avatar: '/images/avatars/default.png' },
|
|
135
|
-
{ id: 2, name: 'DatabaseGuru', avatar: '/images/avatars/default.png' },
|
|
136
|
-
{ id: 3, name: 'NewUser123', avatar: '/images/avatars/default.png' },
|
|
137
|
-
{ id: 4, name: 'ExpertUser', avatar: '/images/avatars/default.png' },
|
|
138
|
-
{ id: 5, name: 'StacksMaster', avatar: '/images/avatars/default.png' }
|
|
139
|
-
]"
|
|
140
|
-
/>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</ForumLayout>
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
const router = useRouter()
|
|
3
|
-
const route = useRoute('/hello-world/[name]')
|
|
4
|
-
const user = useUserStore()
|
|
5
|
-
const { t } = useI18n()
|
|
6
|
-
|
|
7
|
-
watchEffect(() => {
|
|
8
|
-
user.setNewName(route.params.name)
|
|
9
|
-
})
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<div>
|
|
13
|
-
<div text-4xl>
|
|
14
|
-
<div i-carbon-pedestrian inline-block />
|
|
15
|
-
</div>
|
|
16
|
-
<p>
|
|
17
|
-
{{ t('intro.hi', { name: user.savedName }) }}
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
<p text-sm opacity-75>
|
|
21
|
-
<em>{{ t('intro.dynamic-route') }}</em>
|
|
22
|
-
</p>
|
|
23
|
-
|
|
24
|
-
@if(user.otherNames.length)
|
|
25
|
-
<p mt-4 text-sm>
|
|
26
|
-
<span opacity-75>{{ t('intro.aka') }}:</span>
|
|
27
|
-
<ul>
|
|
28
|
-
@foreach(otherName in user.otherNames)
|
|
29
|
-
<li :key="otherName">
|
|
30
|
-
<StxLink :to="`/hello-world/${otherName}`">
|
|
31
|
-
{{ otherName }}
|
|
32
|
-
</StxLink>
|
|
33
|
-
</li>
|
|
34
|
-
@endforeach
|
|
35
|
-
</ul>
|
|
36
|
-
</p>
|
|
37
|
-
@endif
|
|
38
|
-
|
|
39
|
-
<div>
|
|
40
|
-
<button
|
|
41
|
-
m="3 t6" text-sm btn
|
|
42
|
-
@click="router.back()"
|
|
43
|
-
>
|
|
44
|
-
{{ t('button.back') }}
|
|
45
|
-
</button>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
package/views/index.stx
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
defineOptions({
|
|
3
|
-
name: 'HomePage',
|
|
4
|
-
}
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<!-- <Header /> -->
|
|
8
|
-
|
|
9
|
-
<main>
|
|
10
|
-
<ComingSoon />
|
|
11
|
-
<!-- <Hero /> -->
|
|
12
|
-
<!-- <PrimaryFeatures /> -->
|
|
13
|
-
<!-- <PrimaryFeatures2 />
|
|
14
|
-
<SecondaryFeatures />
|
|
15
|
-
<CallToAction />
|
|
16
|
-
<Testimonials />
|
|
17
|
-
<Pricing />
|
|
18
|
-
<Faqs /> -->
|
|
19
|
-
</main>
|
|
20
|
-
|
|
21
|
-
<Footer />
|