App directory refactoring
This commit is contained in:
parent
a53a26f4c0
commit
b312a8c862
153 changed files with 1532 additions and 1447 deletions
|
|
@ -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')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue