single-spa / single-spa.js.org

Home Page:https://single-spa.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth layer implementation example

akshay-nm opened this issue · comments

I stumbled upon a previous issue while looking for ways to handle auth in singla-spa application.

I'd love to work on an example. But I need some guidance on where to put it in the documentation. Moreover, please mention any particular topics that I should hit while documenting.

Originally posted by @frehner in single-spa/single-spa#249 (comment)

I have an example that I maintain, here: https://github.com/filoxo/single-spa-example-rxjs-shared-state
The real purpose of this example is to show how one would share application state across all microfrontends using a utility module, but the real-world usecase I used as the basis to model this example is authentication state. Would this help?

There are also a number of community examples that may be helpful here: https://single-spa.js.org/docs/examples/#community-examples

Closing due to inactivity but feel free to continue the discussion.

Apologies for the delayed response.
I just switched to federated modules and create-mf-app as I was facing difficulties setting up routing using single-spa-router.
I feel it's still far from being compared to the react-router which I am using at the moment. Maybe it's also due to the fact that I am not an expert in single-spa at the moment,
Setting up redirects in single-spa-router is a PITA. 😭

yes single-spa-layout is not intended to be anything like react-router. it's only defines the layout, it does not do any actual routing on the client like a client-side router would (which gets confused with what single-spa would actually be doing, which is listening to routing events and controlling applications based on routes).