1
0

Removed switch statement, changed AuthMethod parsing in authInterceptor to be more generic

This commit is contained in:
Julius Gruber
2019-09-02 15:01:03 +02:00
parent beb0f2d410
commit 901951eaa8
12 changed files with 94 additions and 58 deletions

View File

@@ -0,0 +1,27 @@
import { Component, Injector, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { AuthMethodModel } from '../../core/auth/models/auth-method.model';
import { Store } from '@ngrx/store';
import { AuthState } from '../../core/auth/auth.reducer';
import { getAuthenticationMethods } from '../../core/auth/selectors';
@Component({
selector: 'ds-auth-methods',
templateUrl: './authMethods.component.html',
styleUrls: ['./authMethods.component.scss']
})
export class AuthMethodsComponent implements OnInit {
/**
* The authentication methods data
* @type {AuthMethodModel[]}
*/
@Input() authMethodData: Observable<AuthMethodModel[]>;
constructor( private store: Store<AuthState>) {
}
ngOnInit(): void {
this.authMethodData = this.authMethodData = this.store.select(getAuthenticationMethods);
}
}