mercredi 23 octobre 2019

Dynamic auth with strategies in an angular application

I know it's a pretty general question but hopefully it makes sense.

There are a few auth strategies in the app I'm working on. And depending on whether a user wants to login through some social media or using their own email and password one of those strategies is set for the auth service. The auth service has a few methods like login, logout and a few others and they are called on the strategy, something like this this.strategy.logout().

Everything works nice until the user reloads the page or tries navigating to some page by typing its full url then everything is reset.

Storing the strategy name in the localStorage doesn't look like a good idea. I don't really know how best to go about it.

Aucun commentaire:

Enregistrer un commentaire