digitalfabrik / entitlementcard

App for 'Digitale Berechtigungskarten', generally benefit card for volunteers or socially vulnerable groups in Germany. App for Android & iOS + Backend + Administration Web Portal – 100% Open Source.
MIT License
36 stars 3 forks source link

CORS issue login staging #1639

Closed f1sh1918 closed 3 weeks ago

f1sh1918 commented 1 month ago

Describe the bug As a tester i want to login on staging for testing. When i try to login i get "Server nicht erreichbar"

To Reproduce Steps to reproduce the behavior:

  1. Go to ['...'](https://staging.bayern.ehrenamtskarte.app/)
  2. Try to login (without a CORS plugin)
  3. Check error message
Access to fetch at 'https://api.staging.entitlementcard.app/' from origin 'https://staging.bayern.ehrenamtskarte.app' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*, https://staging.bayern.ehrenamtskarte.app', but only one is allowed. Have the server send the header with a valid value, or, if an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Expected behavior Login works without cors issue

Additional context We changed the backend config flag production: false for staging environment, since we wanted to expose an endpoint only for staging. This is causing the issue. We may introduce a different flag for securing the endpoint or adjusting the CORS configuration here: https://github.com/digitalfabrik/entitlementcard/commit/8201c962f4c24c70892a4df33eb25f59c1579d66

f1sh1918 commented 1 month ago

i will change the production value in salt after this was released. That should fix the isse https://github.com/digitalfabrik/entitlementcard/issues/1417

f1sh1918 commented 3 weeks ago

fixed by this pr https://git.tuerantuer.org/DF/salt/pulls/255/files