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

3
import { DialogService } from '../dialog.service';
Lukas Burgey's avatar
Lukas Burgey committed
4
import { UserService } from '../user.service';
5
import { AllAuthInfo, IdP } from '../types/types.module';
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;
14 15
  public idps: IdP[];
  public selectedIdP: IdP;
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 22
      this.userService.getIdPPreference().subscribe(
        (allAuthInfo: AllAuthInfo) => {
23 24 25
          if (allAuthInfo === null) {
            return;
          }
26 27
          this.idps = allAuthInfo.idps;
          this.selectedIdP = allAuthInfo.selected;
28
        }
29
      );
Lukas Burgey's avatar
Lukas Burgey committed
30
  }
Lukas Burgey's avatar
Lukas Burgey committed
31
}