auth0-angular icon indicating copy to clipboard operation
auth0-angular copied to clipboard

Add a package or support for the AnalogJS Meta Framework

Open SemmelJochen opened this issue 1 year ago • 5 comments

Checklist

  • [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
  • [X] I have looked into the API documentation and have not found a suitable solution or answer.
  • [X] I have searched the issues and have not found a suitable solution or answer.
  • [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • [X] I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

I am trying to setup a new application using AnalogJs. I just tried adding the auth0/angular package and setup as advised in the auth0 docs, but the Login does not work properly. When calling loginWithRedirect() I am able to log in in the Logs I can see a Login Event but no more. In my Application I am not able to use the isAuthenticated and user$ because they are always "false" and "null". Screenshot 2024-06-08 at 20 15 50

In my network tab I can see the following session being set: Screenshot 2024-06-08 at 20 18 50

I also tried the SPA and Regular Web App setup.

Describe the ideal solution

I want to be able to use the auth0 package within my AnalogJs setup

Alternatives and current workarounds

No response

Additional context

No response

SemmelJochen avatar Jun 08 '24 18:06 SemmelJochen

Can you share minimal reproduction so we can look into what's going on?

frederikprijck avatar Jun 20 '24 07:06 frederikprijck

@frederikprijck u can use my test for this. https://github.com/SemmelJochen/nx-coffeelogger-test

SemmelJochen avatar Jun 21 '24 17:06 SemmelJochen

@SemmelJochen can you please explain where to find the relevant code and how to reproduce? Thanks.

frederikprijck avatar Jun 21 '24 17:06 frederikprijck

@frederikprijck sorry, about that. To reproduce. Checkout the repo, npm i (or bun), run "nx serve coffeelogger". Then you login with your Github Account (app must run on localhost:4200 but its default anyway). Then you will be forwarded to the app again and you can see in the logs, that no user will be available. Relevant code:

Tell me if im missing something :)

SemmelJochen avatar Jun 21 '24 17:06 SemmelJochen

Can you confirm that after logging in, the URL still contains code and state query parameters?

If so, can you try and inject AuthService in AppComponent (no need to use it, just inject it) and see if it behaves different?

Additionally, our SDK is build on top of the Angular Router, see https://github.com/auth0/auth0-angular/blob/main/projects/auth0-angular/src/lib/abstract-navigator.ts. So it may be needed to provide your own AbstractNavigator as well.

frederikprijck avatar Jun 24 '24 06:06 frederikprijck