fix: exempt /api/admin/login from admin session check in middleware
The login API was blocked by the admin session middleware, preventing the creation of the session cookie. Now the API endpoint is exempted alongside the login page.
This commit is contained in:
parent
09acf20b9b
commit
117f9fadfc
@ -31,7 +31,7 @@ function getSubdomain(req: NextRequest): string | null {
|
||||
|
||||
export default clerkMiddleware(async (auth, req: NextRequest) => {
|
||||
if (isAdminRoute(req.nextUrl.pathname)) {
|
||||
if (req.nextUrl.pathname === "/admin/login") {
|
||||
if (req.nextUrl.pathname === "/admin/login" || req.nextUrl.pathname === "/api/admin/login") {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user