Guest User

Untitled

a guest
Jun 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import {Component, OnInit} from '@angular/core';
  2. import {Adal4Service} from 'adal-angular4';
  3. import {environment} from '../environments/environment';
  4.  
  5. @Component({
  6. selector: 'app-root',
  7. templateUrl: './app.component.html',
  8. styleUrls: ['./app.component.css']
  9. })
  10. export class AppComponent implements OnInit {
  11. constructor(private adalSvc: Adal4Service) {
  12. this.adalSvc.init(environment.adalConfig);
  13. }
  14.  
  15. ngOnInit(): void {
  16. this.adalSvc.handleWindowCallback();
  17. if (this.adalSvc.userInfo.authenticated) {
  18. var userInfo = this.adalSvc.userInfo;
  19. console.log("On Init:: " + JSON.stringify(userInfo));
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment