argos/dmp-frontend/src/app/ui/auth/login/login.component.ts

30 lines
875 B
TypeScript
Raw Normal View History

import { Component, Input, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { AuthService } from '@app/core/services/auth/auth.service';
import { BaseComponent } from '@common/base/base.component';
2019-01-18 18:03:45 +01:00
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent extends BaseComponent implements OnInit {
2019-01-18 18:03:45 +01:00
@Input() redirect: boolean = true;
@Input() mergeUsers: boolean;
2019-01-18 18:03:45 +01:00
public auth2: any;
private returnUrl: string;
2019-11-13 16:32:55 +01:00
//public cofigurableProviders: ConfigurableProvider[];
2019-01-18 18:03:45 +01:00
constructor(
2019-11-13 16:32:55 +01:00
private authService: AuthService,
private route: ActivatedRoute
2019-01-18 18:03:45 +01:00
) { super(); }
ngOnInit(): void {
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
this.authService.authenticate(this.returnUrl ? this.returnUrl : "/");
}
2019-01-18 18:03:45 +01:00
}