Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated API Key is not functional #4596

Closed
slavakurilyak opened this issue Mar 21, 2024 · 2 comments
Closed

Generated API Key is not functional #4596

slavakurilyak opened this issue Mar 21, 2024 · 2 comments

Comments

@slavakurilyak
Copy link

Bug Description

When attempting to use the generated API Key for accessing resources, the key appears to be non-functional, as indicated by the API Key field turning RED. This issue can be observed when navigating to:

https://docs.twenty.com/rest-api/metadata#/

Example:
Upon visiting the specified URL, the expected behavior is for the API Key to function properly and allow access to the requested resources. However, the key turns red, and the console logs a CORS policy error indicating that the "Access-Control-Allow-Origin" header is missing from the requested resource. Here's a screenshot indicating the issue:

Screen Shot 2024-03-20 at 9 51 55 PM

Expected behavior

The generated API Key should be functional, allowing access to the API without encountering CORS policy errors or any indication (such as the API Key field turning red) that suggests the key is non-functional.

Technical inputs

The issue stems from a CORS policy error, specifically:

metadata#/:1  Access to fetch at 'https://front-kqsk.onrender.com/open-api/metadata' from origin 'https://docs.twenty.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This suggests that the server at https://front-kqsk.onrender.com is not configured to include the necessary Access-Control-Allow-Origin header in its responses. Addressing this by ensuring the server sends the correct CORS headers should resolve the issue.

Disclaimer:

This CRM instance was deployed using Render

@FelixMalfait
Copy link
Member

I think that's because you're querying the frontend. You should put the backend url instead :)

Next week we will release a new docker image that will avoid this kind of problem #4589 ; frontend will be served by the backend directly

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Mar 21, 2024
@gardner
Copy link

gardner commented Jun 20, 2024

This still happens. It's a CORS issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants