login.component.ts 811 Bytes
Newer Older
Lukas Burgey's avatar
Lukas Burgey committed
1
import { Component } from '@angular/core';
Lukas Burgey's avatar
Lukas Burgey committed
2
import { HttpClient } from '@angular/common/http';
Lukas Burgey's avatar
Lukas Burgey committed
3

4
import { DialogService } from '../dialog.service';
Lukas Burgey's avatar
Lukas Burgey committed
5
import { UserService } from '../user.service';
Lukas Burgey's avatar
Lukas Burgey committed
6
7
8
9
10
11

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
Lukas Burgey's avatar
Lukas Burgey committed
12
13
export class LoginComponent {
  private profileDialog;
Lukas Burgey's avatar
Lukas Burgey committed
14
15
  public idps: any[];
  public selectedIdP: number;
Lukas Burgey's avatar
Lukas Burgey committed
16

Lukas Burgey's avatar
Lukas Burgey committed
17
18
  constructor(
    public userService: UserService,
19
    public dialog: DialogService,
Lukas Burgey's avatar
Lukas Burgey committed
20
21
    public http: HttpClient,
  ) {
22
23
    this.selectedIdP = this.userService.getIdPPreference();

Lukas Burgey's avatar
Lukas Burgey committed
24
25
26
    this.userService.getAuthInfo().subscribe(
      data => {
        this.idps = data['idps'];
27
28
29
        if (!this.selectedIdP) {
          this.selectedIdP = data['default'];
        }
Lukas Burgey's avatar
Lukas Burgey committed
30
31
32
      }
    );
  }
Lukas Burgey's avatar
Lukas Burgey committed
33
}