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';
7
7
import { environment } from 'src/environments/environment' ;
8
8
import { EnvironmentType } from 'src/environments/enum' ;
9
9
import { LoginService } from './services/login.service' ;
10
+ import { UserService } from '../user/services/user.service' ;
10
11
11
12
@Component ( {
12
13
selector : 'app-login' ,
@@ -22,7 +23,8 @@ export class LoginComponent implements OnInit {
22
23
private router : Router ,
23
24
private featureToggleCookiesService : FeatureToggleCookiesService ,
24
25
private socialAuthService : SocialAuthService ,
25
- private loginService ?: LoginService
26
+ private loginService ?: LoginService ,
27
+ private userService ?: UserService
26
28
) { }
27
29
28
30
ngOnInit ( ) {
@@ -48,7 +50,14 @@ export class LoginComponent implements OnInit {
48
50
this . azureAdB2CService . signIn ( ) . subscribe ( ( ) => {
49
51
this . featureToggleCookiesService . setCookies ( ) ;
50
52
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
+ } )
52
61
} ) ;
53
62
}
54
63
}
You can’t perform that action at this time.
0 commit comments