fix(pos): allow manifest + relax UUID validation on /pos/sales query
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import type { NextRequest } from 'next/server';
|
||||
|
||||
const PUBLIC_PATHS = ['/login', '/api/auth', '/api/backoffice/auth'];
|
||||
const PUBLIC_PATHS = [
|
||||
'/login',
|
||||
'/api/auth',
|
||||
'/api/backoffice/auth',
|
||||
'/manifest.json',
|
||||
'/manifest.webmanifest',
|
||||
'/favicon.ico',
|
||||
];
|
||||
|
||||
export function proxy(request: NextRequest) {
|
||||
const { pathname } = request.nextUrl;
|
||||
|
||||
// Allow public paths
|
||||
if (PUBLIC_PATHS.some((p) => pathname.startsWith(p))) {
|
||||
// Allow public paths (including PWA manifest, which Authelia was intercepting)
|
||||
if (PUBLIC_PATHS.some((p) => pathname === p || pathname.startsWith(p + '/'))) {
|
||||
return NextResponse.next();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user