# Nuxt 3 - No 'Access-Control-Allow-Origin' header is present

**URL:** <https://community.auth0.com/t/nuxt-3-no-access-control-allow-origin-header-is-present/122615>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [December 8, 2023, 12:00pm UTC](https://community.auth0.com/t/nuxt-3-no-access-control-allow-origin-header-is-present/122615 "2023-12-08T12:00:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CallMeAri](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@CallMeAri](https://community.auth0.com/u/CallMeAri)\
**Post date:** [December 8, 2023, 12:00pm UTC](https://community.auth0.com/t/nuxt-3-no-access-control-allow-origin-header-is-present/122615/1 "2023-12-08T12:00:16Z")

</div>

I have been trying to implement Auth0 in my Nuxt Application and the error I keep on getting is this:  
Access to fetch at ‘[https://march-to-the-polls.us.auth0.com/authorize?response\_type=id\_token&response\_mode=form\_post&client\_id=DxkcUTlJbv9MKRGG7I7SEliHMl8ufN5a&scope=openid%20email&redirect\_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fcallback&nonce=6BmE\_BYeJeEesjyriawUL](https://march-to-the-polls.us.auth0.com/authorize?response_type=id_token&response_mode=form_post&client_id=DxkcUTlJbv9MKRGG7I7SEliHMl8ufN5a&scope=openid%20email&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fcallback&nonce=6BmE_BYeJeEesjyriawUL)’ (redirected from ‘[http://localhost:3000/](http://localhost:3000/)’) from origin ‘[http://localhost:3000](http://localhost:3000)’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

This is the code for the auth0.ts that I have so far:

```auto
import {nanoid} from "nanoid"
import { CorsOrigin } from "vite";
const state = {}; 
const genState = () => { const s = nanoid(); state[s] = 1; return s}
const runtime = useRuntimeConfig()
export const loginRedirectUrl = () => `${runtime.AUTH0_ISSUER_BASE_URL}/authorize?response_type=id_token&response_mode=form_post&client_id=${runtime.AUTH0_CLIENT_ID}&scope=openid%20email&redirect_uri=${encodeURIComponent(runtime.AUTH0_BASE_URL!+"/api/callback")}&nonce=${genState()}`
export const logoutRedirectUrl = (id_token: string) => `${runtime.AUTH0_ISSUER_BASE_URL}/oidc/logout?id_token_hint=${id_token}&post_logout_redirect_uri=${encodeURIComponent(runtime.AUTH0_BASE_URL!+"/api/logout-complete")}&nonce=${genState()}`

export const verifyNonce = (nonce: string) => {
    if (state[nonce]) {
      delete state[nonce]
      return true
    }
    return false
  }

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [December 14, 2023, 4:46pm UTC](https://community.auth0.com/t/nuxt-3-no-access-control-allow-origin-header-is-present/122615/3 "2023-12-14T16:46:21Z")

</div>

Hi @CallMeAri,

Welcome to the Auth0 Community!

Have you set your allowed URLs correctly?

Ref: [No 'Access-Control-Allow-Origin' header issue - #3 by developer6](https://community.auth0.com/t/no-access-control-allow-origin-header-issue/40467/3)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [December 28, 2023, 4:46pm UTC](https://community.auth0.com/t/nuxt-3-no-access-control-allow-origin-header-is-present/122615/4 "2023-12-28T16:46:52Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
