Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 963
Dinesh Ganesan Avatar asked Nov 29 '25 08:11

Dinesh Ganesan


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.

like image 87
Mohammed Al-Kiswani Avatar answered Dec 02 '25 04:12

Mohammed Al-Kiswani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!