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
213 stars 492 forks source link

Login fails on production server setup (non-Docker) #2093

Open terencemo opened 2 months ago

terencemo commented 2 months ago

Description

On multi-tenant production setup, where each tenant runs on a sub-domain of the same parent, e.g abc.mifos.io xyz.mifos.io, we want each tenant to be insulated from the others, so no option to switch backend server. We also want to connect to Fineract on the same sub-domain by default https://xyz.mifos.io connects to https://xyz.mifos.io/fineract-provider/api/v1.

In such a VM setup with Nginx (non-Docker), login tries to use https://demo.fineract.dev/fineract-provider/api/v1/authentication by default and fails, because this URL is down. It should connect to the current production domain by default.

Steps to Reproduce

Setup the web-app on a Server/VM with Nginx as a multi-tenant on subdomain setup (using prefix tenantId.domain.com) with Fineract also on the same domain (non-Docker). Since this is for production, would like each tenant to not need to select the backend but automatically to the same (sub)domain Fineract platform.

Expected Behaviour

Web-app login should connect to Fineract backend server on the same domain and authenticate successfully.

Actual Behaviour

Web-app attempts to connect to https://demo.fineract.dev which has been down since a few years and fails to login

Settings

Screenshots, if any

terencemo commented 1 month ago

This is the desired behaviour for Production: Screenshot 2024-05-22 at 2 36 20 PM Setting the backend server to the same domain by default is accomplished by this PR: https://github.com/openMF/web-app/pull/2095

However, we still have the dropdown visible and I believe it shouldn't be on Production (the above solution was obtained by disabling the backend selector).