App directory refactoring

This commit is contained in:
Darren Clarke 2023-06-26 10:07:12 +00:00 committed by GitHub
parent a53a26f4c0
commit b312a8c862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
153 changed files with 1532 additions and 1447 deletions

View file

@ -21,7 +21,7 @@ const rewriteURL = (request: NextRequestWithAuth, originBaseURL: string, destina
requestHeaders.delete('connection');
console.log({ finalHeaders: requestHeaders });
// console.log({ finalHeaders: requestHeaders });
return NextResponse.rewrite(new URL(destinationURL), { request: { headers: requestHeaders } });
};
@ -43,14 +43,14 @@ const checkRewrites = async (request: NextRequestWithAuth) => {
console.log('proxying to zammad');
const { token } = request.nextauth;
console.log({ nextauth: request.nextauth });
// console.log({ nextauth: request.nextauth });
const headers = {
'X-Forwarded-User': token.email.toLowerCase(),
host: 'link-stack-dev.digiresilience.org'
};
console.log({ headers });
// console.log({ headers });
return rewriteURL(request, `${linkBaseURL}/proxy/zammad`, zammadURL, headers);
} else if (request.nextUrl.pathname.startsWith('/assets') || request.nextUrl.pathname.startsWith('/api/v1')) {