forked from hazza/dspace-angular
Test if reopening PR works
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
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';
|
||||
import { select, Store } from '@ngrx/store';
|
||||
import { getAuthenticationMethods, isAuthenticated, isAuthenticationLoading } from '../../core/auth/selectors';
|
||||
import { CoreState } from '../../core/core.reducers';
|
||||
|
||||
@Component({
|
||||
selector: 'ds-auth-methods',
|
||||
@@ -17,11 +17,29 @@ export class AuthMethodsComponent implements OnInit {
|
||||
*/
|
||||
@Input() authMethodData: Observable<AuthMethodModel[]>;
|
||||
|
||||
constructor( private store: Store<AuthState>) {
|
||||
/**
|
||||
* Whether user is authenticated.
|
||||
* @type {Observable<string>}
|
||||
*/
|
||||
public isAuthenticated: Observable<boolean>;
|
||||
|
||||
/**
|
||||
* True if the authentication is loading.
|
||||
* @type {boolean}
|
||||
*/
|
||||
public loading: Observable<boolean>;
|
||||
|
||||
constructor( private store: Store<CoreState>) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.authMethodData = this.authMethodData = this.store.select(getAuthenticationMethods);
|
||||
|
||||
// set loading
|
||||
this.loading = this.store.pipe(select(isAuthenticationLoading));
|
||||
|
||||
// set isAuthenticated
|
||||
this.isAuthenticated = this.store.pipe(select(isAuthenticated));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user