Skip to content

Commit

Permalink
updated middleware to look more like the astro docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chadananda committed Apr 20, 2024
1 parent 9a45732 commit c0586d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { lucia } from "./lib/auth";
import { verifyRequestOrigin as verifyOrig } from "lucia";
// import { defineMiddleware } from "astro:middleware";

export const onRequest (context, next) {
export const onRequest = async (context, next) => {
const path = new URL(context.request.url).pathname;
// Skip middleware for non-admin paths
if (!path.startsWith('/admin')) return next();
Expand Down

0 comments on commit c0586d1

Please sign in to comment.