@@ -6,27 +6,19 @@ import {
66 OnDestroy ,
77 OnInit ,
88} from '@angular/core' ;
9- import {
10- ActivatedRoute ,
11- RouterLink ,
12- } from '@angular/router' ;
9+ import { ActivatedRoute } from '@angular/router' ;
1310import {
1411 select ,
1512 Store ,
1613} from '@ngrx/store' ;
17- import { TranslatePipe } from '@ngx-translate/core' ;
1814import uniqBy from 'lodash/uniqBy' ;
1915import {
20- combineLatest ,
2116 combineLatestWith ,
2217 map ,
2318 Observable ,
2419 Subscription ,
2520} from 'rxjs' ;
26- import {
27- filter ,
28- shareReplay ,
29- } from 'rxjs/operators' ;
21+ import { filter } from 'rxjs/operators' ;
3022
3123import { environment } from '../../../environments/environment' ;
3224import {
@@ -44,10 +36,8 @@ import {
4436} from '../../core/auth/selectors' ;
4537import { CoreState } from '../../core/core-state.model' ;
4638import { AuthorizationDataService } from '../../core/data/feature-authorization/authorization-data.service' ;
47- import { FeatureID } from '../../core/data/feature-authorization/feature-id' ;
4839import { hasValue } from '../empty.util' ;
4940import { ThemedLoadingComponent } from '../loading/themed-loading.component' ;
50- import { BrowserOnlyPipe } from '../utils/browser-only.pipe' ;
5141import { LogInContainerComponent } from './container/log-in-container.component' ;
5242import {
5343 AUTH_METHOD_FOR_DECORATOR_MAP ,
@@ -61,11 +51,8 @@ import {
6151 changeDetection : ChangeDetectionStrategy . OnPush ,
6252 imports : [
6353 AsyncPipe ,
64- BrowserOnlyPipe ,
6554 LogInContainerComponent ,
66- RouterLink ,
6755 ThemedLoadingComponent ,
68- TranslatePipe ,
6956 ] ,
7057} )
7158export class LogInComponent implements OnInit , OnDestroy {
@@ -103,21 +90,6 @@ export class LogInComponent implements OnInit, OnDestroy {
10390 */
10491 public loading : Observable < boolean > ;
10592
106- /**
107- * Whether or not the current user (or anonymous) is authorized to register an account
108- */
109- canRegister$ : Observable < boolean > ;
110-
111- /**
112- * Whether or not the current user (or anonymous) is authorized to register an account
113- */
114- canForgot$ : Observable < boolean > ;
115-
116- /**
117- * Shows the divider only if contains at least one link to show
118- */
119- canShowDivider$ : Observable < boolean > ;
120-
12193 /**
12294 * Track subscription to unsubscribe on destroy
12395 * @private
@@ -156,18 +128,6 @@ export class LogInComponent implements OnInit, OnDestroy {
156128 this . authService . clearRedirectUrl ( ) ;
157129 }
158130 } ) ;
159-
160- this . canRegister$ = this . authorizationService . isAuthorized ( FeatureID . EPersonRegistration ) ;
161-
162- this . canForgot$ = this . authorizationService . isAuthorized ( FeatureID . EPersonForgotPassword ) . pipe ( shareReplay ( { refCount : false , bufferSize : 1 } ) ) ;
163- this . canShowDivider$ = combineLatest ( [
164- this . canRegister$ ,
165- this . canForgot$ ,
166- this . route . data ,
167- ] ) . pipe (
168- map ( ( [ canRegister , canForgot , routeData ] ) => ( canRegister || canForgot ) && ! routeData ?. isBackDoor ) ,
169- filter ( Boolean ) ,
170- ) ;
171131 }
172132
173133 filterAndSortAuthMethods ( authMethods : AuthMethod [ ] , isBackdoor : boolean , isPasswordLoginEnabledForAdminsOnly = false ) : AuthMethod [ ] {
0 commit comments