I have a dummy application that serves tickets separated in two apps and a database.
One app is the backend app, it knows only JSON and serves a port in a specific container locally. It handles everything persistent including users. It uses bearer token as authentication.
The other app is the web app which serves templated html. It serves the login page and is completely stateless.
This is causing duplication of the api, and my front web server is reduced to transparent cookie-to-bearer.
Is there any way to handle the auth flow in a microservice(s) architecture that allows js authed request and doesn't involve duplicating the api in the front web server ?