[GH-ISSUE #1156] Cors error over the api #334

Closed
opened 2026-02-26 18:46:33 +03:00 by kerem · 1 comment
Owner

Originally created by @ThcDelux3 on GitHub (May 14, 2024).
Original GitHub issue: https://github.com/documenso/documenso/issues/1156

Issue Description

Hey,

i wanted to test the API today to create some Contracts. Sadly i encourted an Cors error.

When I run cors testet i dont get back an access-control-allow-origin

https://cors-test.codehappy.dev/?url=https%3A%2F%2Fdocumenso.cr1.rr.business%2Fapi%2Fv1%2Fdocuments&origin=https%3A%2F%2Fcors-test.codehappy.dev%2F&method=get

Is there an error in my approach or is there an .env variable where I need to allow other Domains?

Steps to Reproduce

Docker image documenso/documenso:latest

ENV:

NEXTAUTH_SECRET=*
NEXTAUTH_URL=https://documenso.cr1.rr.business/
NEXT_PRIVATE_ENCRYPTION_KEY=*
NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=*
NEXT_PUBLIC_WEBAPP_URL=https://documenso.cr1.rr.business/
NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth
NEXT_PRIVATE_SMTP_HOST=*
NEXT_PRIVATE_SMTP_PORT=25
NEXT_PRIVATE_SMTP_USERNAME=*
NEXT_PRIVATE_SMTP_PASSWORD=*
NEXT_PRIVATE_DATABASE_URL=*
NEXT_PRIVATE_DIRECT_DATABASE_URL=*
NEXT_PUBLIC_DISABLE_SIGNUP=true
NEXT_PRIVATE_SMTP_FROM_NAME=R²
NEXT_PRIVATE_SMTP_FROM_ADDRESS=*
NEXT_PUBLIC_UPLOAD_TRANSPORT=s3
NEXT_PRIVATE_UPLOAD_ENDPOINT=*
NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=false
NEXT_PRIVATE_UPLOAD_REGION=unknown
NEXT_PRIVATE_UPLOAD_BUCKET=*
NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=*
NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=*

Expected Behavior

No Cors Error Api should answer

Current Behavior

CORS ERROR:

Bildschirmfoto 2024-05-14 um 20 18 05

Screenshots (optional)

No response

Operating System [e.g., Windows 10]

No response

Browser [e.g., Chrome, Firefox]

Crome latest version

Version [e.g., 2.0.1]

No response

Please check the boxes that apply to this issue report.

  • I have searched the existing issues to make sure this is not a duplicate.
  • I have provided steps to reproduce the issue.
  • I have included relevant environment information.
  • I have included any relevant screenshots.
  • I understand that this is a voluntary contribution and that there is no guarantee of resolution.
  • I want to work on creating a PR for this issue if approved
Originally created by @ThcDelux3 on GitHub (May 14, 2024). Original GitHub issue: https://github.com/documenso/documenso/issues/1156 ### Issue Description Hey, i wanted to test the API today to create some Contracts. Sadly i encourted an Cors error. When I run cors testet i dont get back an access-control-allow-origin https://cors-test.codehappy.dev/?url=https%3A%2F%2Fdocumenso.cr1.rr.business%2Fapi%2Fv1%2Fdocuments&origin=https%3A%2F%2Fcors-test.codehappy.dev%2F&method=get Is there an error in my approach or is there an .env variable where I need to allow other Domains? ### Steps to Reproduce Docker image documenso/documenso:latest ENV: NEXTAUTH_SECRET=* NEXTAUTH_URL=https://documenso.cr1.rr.business/ NEXT_PRIVATE_ENCRYPTION_KEY=* NEXT_PRIVATE_ENCRYPTION_SECONDARY_KEY=* NEXT_PUBLIC_WEBAPP_URL=https://documenso.cr1.rr.business/ NEXT_PRIVATE_SMTP_TRANSPORT=smtp-auth NEXT_PRIVATE_SMTP_HOST=* NEXT_PRIVATE_SMTP_PORT=25 NEXT_PRIVATE_SMTP_USERNAME=* NEXT_PRIVATE_SMTP_PASSWORD=* NEXT_PRIVATE_DATABASE_URL=* NEXT_PRIVATE_DIRECT_DATABASE_URL=* NEXT_PUBLIC_DISABLE_SIGNUP=true NEXT_PRIVATE_SMTP_FROM_NAME=R² NEXT_PRIVATE_SMTP_FROM_ADDRESS=* NEXT_PUBLIC_UPLOAD_TRANSPORT=s3 NEXT_PRIVATE_UPLOAD_ENDPOINT=* NEXT_PRIVATE_UPLOAD_FORCE_PATH_STYLE=false NEXT_PRIVATE_UPLOAD_REGION=unknown NEXT_PRIVATE_UPLOAD_BUCKET=* NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID=* NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY=* ### Expected Behavior No Cors Error Api should answer ### Current Behavior CORS ERROR: <img width="823" alt="Bildschirmfoto 2024-05-14 um 20 18 05" src="https://github.com/documenso/documenso/assets/25651512/96145167-a372-4880-afbf-b1f1d98c75bc"> ### Screenshots (optional) _No response_ ### Operating System [e.g., Windows 10] _No response_ ### Browser [e.g., Chrome, Firefox] Crome latest version ### Version [e.g., 2.0.1] _No response_ ### Please check the boxes that apply to this issue report. - [X] I have searched the existing issues to make sure this is not a duplicate. - [X] I have provided steps to reproduce the issue. - [X] I have included relevant environment information. - [X] I have included any relevant screenshots. - [X] I understand that this is a voluntary contribution and that there is no guarantee of resolution. - [ ] I want to work on creating a PR for this issue if approved
kerem 2026-02-26 18:46:33 +03:00
Author
Owner

@ThcDelux3 commented on GitHub (May 15, 2024):

I thin i thoght wrong :D When using laravel to send the api call it works fine. Maybe you shouldnt send API calls from the fronted directly.

<!-- gh-comment-id:2113153336 --> @ThcDelux3 commented on GitHub (May 15, 2024): I thin i thoght wrong :D When using laravel to send the api call it works fine. Maybe you shouldnt send API calls from the fronted directly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#334
No description provided.