# authService.loginWithPopup() works, authService.loginWithRedirect() does not. Anuglar 10

**URL:** <https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485>\
**Category:** Get Help\
**Created:** [October 13, 2020, 11:15am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485 "2020-10-13T11:15:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjl.industries.us](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pjl.industries.us/32/16245_2.png) [@pjl.industries.us](https://community.auth0.com/u/pjl.industries.us)\
**Post date:** [October 13, 2020, 11:15am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/1 "2020-10-13T11:15:24Z")

</div>

Hi,

Currently trying to retrofit an existing Angular 10 application with Auth0, but I’m experiencing inconsistent behavior with `authService.isAuthenticated$` after successfully authenticating. When I use `loginWithPopup()` isAuthenticated$ works as expected, but when I use loginWithRedirect(), isAuthenticated$ always returns false – even with significant delay.

Is there any known difference between popup and redirect that would cause this? I’ve gotten the demo to work as expected, so it’s clearly something with how my existing app is configured, but I can’t find any discernible difference between the sample app and my existing app that would cause isAuthenticated$ to always return false after successfully authenticating via loginWithRedirect.

Thanks.

---

<div class="post-metadata">

**Author:** ![emanuil.stoyanov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuil.stoyanov/32/25093_2.png) [@emanuil.stoyanov](https://community.auth0.com/u/emanuil.stoyanov)\
**Post date:** [November 4, 2020, 6:14pm UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/3 "2020-11-04T18:14:54Z")

</div>

I have exactly the same issue. Have you found any solution?

---

<div class="post-metadata">

**Author:** ![emanuil.stoyanov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuil.stoyanov/32/25093_2.png) [@emanuil.stoyanov](https://community.auth0.com/u/emanuil.stoyanov)\
**Post date:** [November 5, 2020, 8:55am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/4 "2020-11-05T08:55:53Z")

</div>

Are you using HashLocationStrategy in your app. This may be the issue?

provide: LocationStrategy, useClass: HashLocationStrategy

---

<div class="post-metadata">

**Author:** ![pjl.industries.us](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pjl.industries.us/32/16245_2.png) [@pjl.industries.us](https://community.auth0.com/u/pjl.industries.us)\
**Post date:** [November 5, 2020, 9:57am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/5 "2020-11-05T09:57:08Z")

</div>

Yep, that was my issue as well. Thanks!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 5, 2020, 10:12am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/6 "2020-11-05T10:12:05Z")

</div>

Teamwork makes the dreamwork! Thanks for sharing the solution!

---

<div class="post-metadata">

**Author:** ![emanuil.stoyanov](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emanuil.stoyanov/32/25093_2.png) [@emanuil.stoyanov](https://community.auth0.com/u/emanuil.stoyanov)\
**Post date:** [November 6, 2020, 10:02am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/7 "2020-11-06T10:02:00Z")

</div>

Actually this solution is not suitable in my case. I am developing an Excel Add-in based on Angular. I am using officejs library which specifically requires hash based routing.

I’ve seen several articles where you are suggesting the usage of non-hash based routing for angular apps when loginWithRedirect is used. My impression is that even though is not advisory it is still possible. I am trying to do what is suggested in the following article [Universal login and hash-based routing in angularjs app](https://community.auth0.com/t/universal-login-and-hash-based-routing-in-angularjs-app/9854) , but without any success.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 21, 2020, 10:02am UTC](https://community.auth0.com/t/authservice-loginwithpopup-works-authservice-loginwithredirect-does-not-anuglar-10/51485/8 "2020-11-21T10:02:05Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
