2018-01-10 17:05:23 +01:00
|
|
|
import { LoginService } from '../../utilties/login-service';
|
2018-10-05 17:00:54 +02:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2018-01-10 17:05:23 +01:00
|
|
|
import { Router, ActivatedRoute, Params } from '@angular/router';
|
|
|
|
|
|
|
|
@Component({
|
2018-10-05 17:00:54 +02:00
|
|
|
selector: 'app-linkedin-login',
|
|
|
|
templateUrl: './linkedin-login.component.html',
|
2018-01-10 17:05:23 +01:00
|
|
|
})
|
|
|
|
export class LinkedInLoginComponent implements OnInit {
|
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
constructor(
|
|
|
|
private router: Router,
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
private loginService: LoginService
|
|
|
|
) {
|
2018-01-10 17:05:23 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
2018-01-10 17:05:23 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
ngOnInit(): void {
|
|
|
|
this.route.queryParams.subscribe((data: any) => {
|
|
|
|
if (!data['code']) { this.loginService.linkedinAuthorize(); } else { this.loginService.linkedInloginUser(data['code']); }
|
|
|
|
});
|
|
|
|
}
|
2018-01-10 17:05:23 +01:00
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|