feat: middleware load auth from url
This commit is contained in:
parent
5dc72873d5
commit
52081c46d5
|
|
@ -6,7 +6,8 @@ import { internalFetch } from '@gitroom/helpers/utils/internal.fetch';
|
|||
// This function can be marked `async` if using `await` inside
|
||||
export async function middleware(request: NextRequest) {
|
||||
const nextUrl = request.nextUrl;
|
||||
const authCookie = request.cookies.get('auth');
|
||||
const authCookie = request.cookies.get('auth') || request.headers.get('auth') || nextUrl.searchParams.get('loggedAuth');
|
||||
|
||||
if (
|
||||
nextUrl.pathname.startsWith('/uploads/') ||
|
||||
nextUrl.pathname.startsWith('/p/') ||
|
||||
|
|
|
|||
Loading…
Reference in New Issue