2023-10-12 16:13:04 +02:00
|
|
|
import { Component, Input, OnInit } from '@angular/core';
|
2023-10-18 11:10:24 +02:00
|
|
|
import { ActivatedRoute } from '@angular/router';
|
2019-12-11 15:51:03 +01:00
|
|
|
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']
|
|
|
|
})
|
2023-10-12 16:13:04 +02:00
|
|
|
export class LoginComponent extends BaseComponent implements OnInit {
|
2019-01-18 18:03:45 +01:00
|
|
|
|
2022-04-19 09:28:35 +02:00
|
|
|
@Input() redirect: boolean = true;
|
2020-10-26 12:24:39 +01:00
|
|
|
@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,
|
2023-10-18 11:10:24 +02:00
|
|
|
private route: ActivatedRoute
|
2019-01-18 18:03:45 +01:00
|
|
|
) { super(); }
|
|
|
|
|
|
|
|
ngOnInit(): void {
|
2023-10-18 11:10:24 +02:00
|
|
|
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
|
|
|
|
this.authService.authenticate(this.returnUrl ? this.returnUrl : "/");
|
2020-10-26 17:18:26 +01:00
|
|
|
}
|
2019-01-18 18:03:45 +01:00
|
|
|
}
|