ekangularbasetest3
Version:
Authentication service for usermanagement(oidc client)
51 lines (37 loc) • 1.29 kB
text/typescript
import { Component, OnInit, Inject } from '@angular/core';
import { Router, ActivatedRoute, Params } from '@angular/router';
import { BlockUI, NgBlockUI } from 'ng-block-ui';
import { AuthService } from '../../auth/auth.service';
import { RouteHandleService } from '../RouteHandle.service';
({
selector: 'app-auth-callback',
templateUrl: './auth-callback.component.html',
styleUrls: ['./auth-callback.component.css']
})
export class AuthCallbackComponent implements OnInit {
() blockUI: NgBlockUI;
baseu:string;
constructor( ('BASE_URL') baseUrl: string,private authService: AuthService,
public router: Router,public routehandleservice: RouteHandleService) {
this.baseu = baseUrl;
}
ngOnInit() {
if(this.routehandleservice.isUrlExist())
{
this.routehandleservice.showblockUi();
}
else
{
this.blockUI.start("Redirecting to Main Page");
}
console.log("AuthCallbackComponent start");
// alert("111");
this.authService.completeAuthentication().then(s=>
{
if(this.authService.isLoggedIn()==true) {
location.assign(this.baseu+'/');
}
}
);
}
}