# How to Fix CORS Error

Cross-Origin Resource Sharing (CORS) error may occur when you do not add the domain of your application (the origin) as an **Authorized Redirect URI** in your Authgear client application.

You can see more details about a CORS error in the JavaScript Console on your browser.

<figure><img src="/files/FX0KKsnfSfauriTjw4GF" alt=""><figcaption><p>example showing CORS error on Chrome JavaScript Console</p></figcaption></figure>

### Fix

To add your domain as an Authorized Redirect URI, first navigate to **Applications** > **\[Your Client Application]** in Authgear Portal.

Click on the **Add URI** button under the Authorized Redirect URIs section. Add an Authorized Redirect URI that includes the full domain name of the domain from which your website or application will be making requests to the Authgear endpoints.

Save your settings in Authgear Portal, retry your application, and the CORS error should go away.

<figure><img src="/files/p6Z6ahcUmjoLY2fQXtPF" alt=""><figcaption><p>example showing authorized redirect URI in Portal</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.authgear.com/troubleshooting/how-to-fix-cors-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
