Open Closed

Angular - Run code on successful login #3111


User avatar
0
clearlaunch created

In my Angular application I'm trying to call some code to initialize my application after a user has successfully logged in.

I was using the separate login pages from the server so I had this initialization in the AppModule since the user was being authenticated before starting the angular app.

Now I've switched to the login pages within angular so the AppModule creation happens before I know a user has successfully logged in.

Any suggestions on a single point of entry for Angular when a user has successfully finished login.


1 Answer(s)
  • User Avatar
    0
    muhammedaltug created

    Hello,

    You can use OAuthService's hasValidAccessToken method for checking user has successfully logged in.

    You can use angular's APP_INITIALIZER token for running control during app initialization

Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11