MSAL-Angular is there any event or callback available for signup completed?

Viewed 1084

We are using MSAL-Angular in our app. Is there any event or callback available for user successfully signed up like "msal:loginSuccess"

1 Answers

I think you can use the "newUser" claim in the idTokenClaims from the "msal:loginSuccess" response.

this.broadcastService.subscribe('msal:loginSuccess', (success) => {
  if(success.idTokenClaims.newUser){
    console.log('this is a new user');
  }
}

Here is a sample image from the response:

Here is a sample image from the response

the "newUser" boolean flag will be returned on login success if this is the first time this user login to the system.

Related