One solution is to do your client-side routing using the $ route service.
When a user authenticates through Firebase, save a record of this on the client, for example, in localstorage, some comprehensive controller or your own Angular service (my preferred option).
In your routing controller, if the user is authenticated, redirect to /some_page , otherwise redirect to /login and track the $ location where the user should go.
If, on the other hand, you want to route your server, you can use the solution you are attached to by generating your Firehase auth tokens server .
source share