# NextJS - CORS No 'Access-Control-Allow-Origin' header is present on the requested resource

**URL:** <https://community.auth0.com/t/nextjs-cors-no-access-control-allow-origin-header-is-present-on-the-requested-resource/125578>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [January 24, 2024, 1:10pm UTC](https://community.auth0.com/t/nextjs-cors-no-access-control-allow-origin-header-is-present-on-the-requested-resource/125578 "2024-01-24T13:10:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![noelt.dolan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/noelt.dolan/32/60288_2.png) [@noelt.dolan](https://community.auth0.com/u/noelt.dolan)\
**Post date:** [January 24, 2024, 1:13pm UTC](https://community.auth0.com/t/nextjs-cors-no-access-control-allow-origin-header-is-present-on-the-requested-resource/125578/2 "2024-01-24T13:13:05Z")

</div>

Also, for further reference, here is the basic /api/auth/[auth0]/route.ts setup.

```auto
import { handleAuth, handleLogin, handleLogout } from '@auth0/nextjs-auth0';

const logoutUrl = [
  `${process.env.AUTH0_ISSUER_BASE_URL}/v2/logout?`,
  `client_id=${process.env.AUTH0_CLIENT_ID}`,
  `&returnTo=${process.env.AUTH0_BASE_URL}`,
];

export const GET = handleAuth({
  login: handleLogin({
    returnTo: '/',
  }),
  logout: handleLogout({
    returnTo: logoutUrl.join(''),
  }),
});

```

---

_[View the full topic](https://community.auth0.com/t/nextjs-cors-no-access-control-allow-origin-header-is-present-on-the-requested-resource/125578)._
