Is it possible to have a service only used by an AuthGuard in the same module be a singleton?

jerotas

Brian H

Posted on May 1, 2024

Is it possible to have a service only used by an AuthGuard in the same module be a singleton?

I haven't been able to get it to work. It seems like the constructor of the auth guard is only called once, but I get a different instance of the service when canActivate is called in the guard.

Is there a way to confirm this? Is there a thing I can log to get the instanceId of the service or something?

💖 💪 🙅 🚩
jerotas
Brian H

Posted on May 1, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related