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.
@@ -280,13 +280,13 @@ export default defineMiddleware({
280
280
  priority: 10,
281
281
  include: "/admin/**",
282
282
  handler: (req, res, next) => {
283
- const authHeader = req.headers.authorization;
283
+ const auth = req.sprint.getAuthorization();
284
284
 
285
- if (!authHeader) {
285
+ if (!auth) {
286
286
  return res.status(401).json({ error: "No authorization header" });
287
287
  }
288
288
 
289
- const token = authHeader.replace("Bearer ", "");
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 authHeader = req.headers.authorization;
307
+ const auth = req.sprint.getAuthorization();
308
308
 
309
- if (!authHeader) {
309
+ if (!auth) {
310
310
  return res.status(401).json({ error: "No authorization header" });
311
311
  }
312
312
 
313
- const token = authHeader.replace("Bearer ", "");
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-sprint",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "description": "Create a new Sprint API project",
5
5
  "type": "module",
6
6
  "bin": {
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 authHeader = req.headers.authorization;
298
+ const auth = req.sprint.getAuthorization();
299
299
 
300
- if (!authHeader) {
300
+ if (!auth) {
301
301
  return res.status(401).json({ error: "No authorization header" });
302
302
  }
303
303
 
304
- const token = authHeader.replace("Bearer ", "");
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 authHeader = req.headers.authorization;
322
+ const auth = req.sprint.getAuthorization();
323
323
 
324
- if (!authHeader) {
324
+ if (!auth) {
325
325
  return res.status(401).json({ error: "No authorization header" });
326
326
  }
327
327
 
328
- const token = authHeader.replace("Bearer ", "");
328
+ const token = auth.replace("Bearer ", "");
329
329
 
330
330
  if (token !== "admin-token") {
331
331
  return res.status(403).json({ error: "Invalid token" });