File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { SocialAuthService, SocialUser } from 'angularx-social-login';
77import { environment } from 'src/environments/environment' ;
88import { EnvironmentType } from 'src/environments/enum' ;
99import { LoginService } from './services/login.service' ;
10+ import { UserService } from '../user/services/user.service' ;
1011
1112@Component ( {
1213 selector : 'app-login' ,
@@ -22,7 +23,8 @@ export class LoginComponent implements OnInit {
2223 private router : Router ,
2324 private featureToggleCookiesService : FeatureToggleCookiesService ,
2425 private socialAuthService : SocialAuthService ,
25- private loginService ?: LoginService
26+ private loginService ?: LoginService ,
27+ private userService ?: UserService
2628 ) { }
2729
2830 ngOnInit ( ) {
@@ -48,7 +50,14 @@ export class LoginComponent implements OnInit {
4850 this . azureAdB2CService . signIn ( ) . subscribe ( ( ) => {
4951 this . featureToggleCookiesService . setCookies ( ) ;
5052 this . azureAdB2CService . setCookies ( ) ;
51- this . router . navigate ( [ '' ] ) ;
53+ const userId = this . azureAdB2CService . getUserId ( )
54+ this . userService . loadUser ( userId ) . subscribe ( ( user ) => {
55+ const user_groups = {
56+ groups : user . groups
57+ }
58+ this . loginService . setLocalStorage ( 'user' , JSON . stringify ( user_groups ) ) ;
59+ this . router . navigate ( [ '' ] ) ;
60+ } )
5261 } ) ;
5362 }
5463 }
You can’t perform that action at this time.
0 commit comments