openMF / web-app

Mifos X Web App is the revamped version of the Mifos X Community App built on top of the Fineract Platform leveraging the popular Angular framework.
https://openmf.github.io/web-app/
Mozilla Public License 2.0
230 stars 533 forks source link

CORS issue prevents UI from working locally #701

Closed stdunbar closed 1 year ago

stdunbar commented 4 years ago

When running against an against a local server, CORS error prevent the application from doing anything.

Steps to Reproduce

  1. Checkout fineract 1.4.0 or develop branch from github.com/apache/fineract
  2. docker run --name mysql-5.5 -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mysql -d mysql:5.5
  3. ./gradlew createDB -PdbName=fineract_tenants
  4. ./gradlew createDB -PdbName=fineract_default
  5. ./gradlew tomcatRunWAR
  6. Check out web-app, master branch
  7. npm install
  8. ng serve
  9. Open browser, go to http://localhost:4200/
  10. Login with user mifos, password password

Expected Behaviour

Login should work

Actual Behaviour

Login fails because of CORS error:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8080/fineract-provider/api/v1/authentication?username=mifos&password=password. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Settings

Screenshots

HarimbolaSantatra commented 3 months ago

For those who still encounter CORS issue, here's a sample nginx configuration to make it work