I'm using api route in Nextjs to send a message but when i use console.log to display to response, i received HTML, can u help me with this? This is the error
`Server Error
Error:
Just a moment...
chat.openai.com
Checking if the site connection is secure
Enable JavaScript and cookies to continue
chat.openai.com needs to review the security of your connection before proceeding.
(function(){
window._cf_chl_opt={
cvId: '2',
cType: 'managed',
cNounce: '7677',
cRay: '7789328c49182108',
cHash: '343087d50ab1a32',
cUPMDTk: "\/api\/auth\/session?__cf_chl_tk=eM3lmAPV6muNTcdPhBa77e2zCsr6Go9R_Stddqr9Hus-1670876812-0-gaNycGzNCdE",
cFPWv: 'b',
cTTimeMs: '1000',
cTplV: 4,
cTplB: 'cf',
cRq: {
ru: 'aHR0cHM6Ly9jaGF0Lm9wZW5haS5jb20vY2hhdC9mcm9udGVuZC8vYXBpL2F1dGgvc2Vzc2lvbg==',
ra: 'TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTVfNykgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEwNy4wLjAuMCBTYWZhcmkvNTM3LjM2',
rm: 'R0VU',
d: 'SHR0eON9GDDPV8Z+Lpo7x3fl1b4JO6iiw3E9tYL8tlQWAV54epR+Vu8xp/Q+djaU9rQVS+nevUKJmDcjDQcIhCjB7fYUwQgksUymjqSfzlm3WfmsZwL42ri0NkbI3I1fYAd2bVTkIkKk9Xu67YKtVClQ6OOz3PEGQyyJaOoNGX29S8Dw4NOmRFa3YJsiBLAmoTzcsXlr+5TOffV9X3ztlAMYsos5jdA/2AOmfi7SfiyIrAUuv4ADZqjZjDP8255nJNmzEtHUJ6bWp9NIEgWu4bg4lUxGd8xFruDkF/xmaqCGtWYD1wpKDF3+jy3c+UiuCJDYD8EpjwyYUidZorEJojgqxy8Ib+oiC6zZFD4GTbUkOG765BJ+idsCmW4EGbTdwulIecbhz0mzzqCr3pjN04NYUBIR3qPQUauXNXzwqxtbbzNd8+8pEuuBap7gYhuj6oSpku64z7vghoFQ1zGDlVLjPUQEQ6SyTcfsWnJtnyMq/XN2QCt6FEX6UBYn3ucLI1EHBINDUbub7sJr60G7BAhufAOlZ3PbV9OJz8gwqmfOb0m5P/sRvZxRK0Uc7+eXEdjRZGH7c1FfhNXgN9MUsxQpTZ9nY+idV3uhXKHlQFiGws1HQbgV+mBVU+bJz587/1A/g9snBmRKtRciy5U/cA==',
t: 'MTY3MDg3NjgxMi4yMTMwMDA=',
m: 'tSC98nDSFy35ZgHcoXz7Bi/SbCrcfnqT+L66sjV7has=',
i1: 'nL4Sfn+x+gytJPJtg9j11w==',
i2: 'cw3Kccg1CvxCqkbs0mYoXQ==',
zh: 'iuyN59AGNgeBFFEOPj72EN+xtBfXXvoCyd1dJnIVFAc=',
uh: 'SGmJ2TxFMj7i8M0b5lAntAD+xr4TnJ0AJgm+HF4vWLo=',
hh: 'foaWmAUHGGlVCZaNUJIHhxzxFNzSPNnVe6rJjiQw728=',
}
};
var trkjs = document.createElement('img');
trkjs.setAttribute('src', '/cdn-cgi/images/trace/managed/js/transparent.gif?ray=7789328c49182108');
trkjs.setAttribute('style', 'display: none');
document.body.appendChild(trkjs);
var cpo = document.createElement('script');
cpo.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/managed/v1?ray=7789328c49182108';
window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;
window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, -window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;
if (window.history && window.history.replaceState) {
var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;
history.replaceState(null, null, "\/api\/auth\/session?__cf_chl_rt_tk=eM3lmAPV6muNTcdPhBa77e2zCsr6Go9R_Stddqr9Hus-1670876812-0-gaNycGzNCdE" + window._cf_chl_opt.cOgUHash);
cpo.onload = function() {
history.replaceState(null, null, ogU);
};
}
document.getElementsByTagName('head')[0].appendChild(cpo);
}());
`
The issue names a Next.js API route and the /api/auth/session request but provides no repository file or test to start from. Reproduce the request and trace why the route receives the Cloudflare HTML challenge instead of the expected message response; done means the API route returns the intended response rather than the challenge page.
Written by the indexing model from the issue text.