create-sprint 0.0.34 → 0.0.36
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/dist/generators.js +6 -6
- package/package.json +1 -1
- package/src/generators.ts +6 -6
package/dist/generators.js
CHANGED
|
@@ -280,13 +280,13 @@ export default defineMiddleware({
|
|
|
280
280
|
priority: 10,
|
|
281
281
|
include: "/admin/**",
|
|
282
282
|
handler: (req, res, next) => {
|
|
283
|
-
const
|
|
283
|
+
const auth = req.sprint.getAuthorization();
|
|
284
284
|
|
|
285
|
-
if (!
|
|
285
|
+
if (!auth) {
|
|
286
286
|
return res.status(401).json({ error: "No authorization header" });
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
const token =
|
|
289
|
+
const token = auth.replace("Bearer ", "");
|
|
290
290
|
|
|
291
291
|
if (token !== "admin-token") {
|
|
292
292
|
return res.status(403).json({ error: "Invalid token" });
|
|
@@ -304,13 +304,13 @@ export default defineMiddleware({
|
|
|
304
304
|
priority: 10,
|
|
305
305
|
include: "/admin/**",
|
|
306
306
|
handler: (req, res, next) => {
|
|
307
|
-
const
|
|
307
|
+
const auth = req.sprint.getAuthorization();
|
|
308
308
|
|
|
309
|
-
if (!
|
|
309
|
+
if (!auth) {
|
|
310
310
|
return res.status(401).json({ error: "No authorization header" });
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const token =
|
|
313
|
+
const token = auth.replace("Bearer ", "");
|
|
314
314
|
|
|
315
315
|
if (token !== "admin-token") {
|
|
316
316
|
return res.status(403).json({ error: "Invalid token" });
|
package/package.json
CHANGED
package/src/generators.ts
CHANGED
|
@@ -295,13 +295,13 @@ export default defineMiddleware({
|
|
|
295
295
|
priority: 10,
|
|
296
296
|
include: "/admin/**",
|
|
297
297
|
handler: (req, res, next) => {
|
|
298
|
-
const
|
|
298
|
+
const auth = req.sprint.getAuthorization();
|
|
299
299
|
|
|
300
|
-
if (!
|
|
300
|
+
if (!auth) {
|
|
301
301
|
return res.status(401).json({ error: "No authorization header" });
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
const token =
|
|
304
|
+
const token = auth.replace("Bearer ", "");
|
|
305
305
|
|
|
306
306
|
if (token !== "admin-token") {
|
|
307
307
|
return res.status(403).json({ error: "Invalid token" });
|
|
@@ -319,13 +319,13 @@ export default defineMiddleware({
|
|
|
319
319
|
priority: 10,
|
|
320
320
|
include: "/admin/**",
|
|
321
321
|
handler: (req, res, next) => {
|
|
322
|
-
const
|
|
322
|
+
const auth = req.sprint.getAuthorization();
|
|
323
323
|
|
|
324
|
-
if (!
|
|
324
|
+
if (!auth) {
|
|
325
325
|
return res.status(401).json({ error: "No authorization header" });
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
const token =
|
|
328
|
+
const token = auth.replace("Bearer ", "");
|
|
329
329
|
|
|
330
330
|
if (token !== "admin-token") {
|
|
331
331
|
return res.status(403).json({ error: "Invalid token" });
|