1- import { combineLatest , Observable , shareReplay } from 'rxjs' ;
2- import { filter , map } from 'rxjs/operators' ;
1+ import { map } from 'rxjs/operators' ;
32import { Component , Inject , OnInit } from '@angular/core' ;
43import { UntypedFormBuilder , UntypedFormGroup , Validators } from '@angular/forms' ;
54
65import { select , Store } from '@ngrx/store' ;
6+ import { Observable } from 'rxjs' ;
77import { AuthenticateAction , ResetAuthenticationMessagesAction } from '../../../../core/auth/auth.actions' ;
88
99import { getAuthenticationError , getAuthenticationInfo , } from '../../../../core/auth/selectors' ;
@@ -16,8 +16,8 @@ import { AuthService } from '../../../../core/auth/auth.service';
1616import { HardRedirectService } from '../../../../core/services/hard-redirect.service' ;
1717import { CoreState } from '../../../../core/core-state.model' ;
1818import { getForgotPasswordRoute , getRegisterRoute } from '../../../../app-routing-paths' ;
19- import { FeatureID } from '../../../../core/data/feature-authorization/feature-id' ;
2019import { AuthorizationDataService } from '../../../../core/data/feature-authorization/authorization-data.service' ;
20+ import { FeatureID } from '../../../../core/data/feature-authorization/feature-id' ;
2121
2222/**
2323 * /users/sign-in
@@ -64,7 +64,7 @@ export class LogInPasswordComponent implements OnInit {
6464
6565 /**
6666 * The authentication form.
67- * @type {UntypedFormGroup }
67+ * @type {FormGroup }
6868 */
6969 public form : UntypedFormGroup ;
7070
@@ -73,16 +73,6 @@ export class LogInPasswordComponent implements OnInit {
7373 */
7474 public canRegister$ : Observable < boolean > ;
7575
76- /**
77- * Whether or not the current user (or anonymous) is authorized to register an account
78- */
79- canForgot$ : Observable < boolean > ;
80-
81- /**
82- * Shows the divider only if contains at least one link to show
83- */
84- canShowDivider$ : Observable < boolean > ;
85-
8676
8777 constructor (
8878 @Inject ( 'authMethodProvider' ) public injectedAuthMethodModel : AuthMethod ,
@@ -126,14 +116,7 @@ export class LogInPasswordComponent implements OnInit {
126116 } )
127117 ) ;
128118
129- this . canRegister$ = this . authorizationService . isAuthorized ( FeatureID . EPersonRegistration ) . pipe ( shareReplay ( 1 ) ) ;
130- this . canForgot$ = this . authorizationService . isAuthorized ( FeatureID . EPersonForgotPassword ) . pipe ( shareReplay ( 1 ) ) ;
131- this . canShowDivider$ =
132- combineLatest ( [ this . canRegister$ , this . canForgot$ ] )
133- . pipe (
134- map ( ( [ canRegister , canForgot ] ) => canRegister || canForgot ) ,
135- filter ( Boolean )
136- ) ;
119+ this . canRegister$ = this . authorizationService . isAuthorized ( FeatureID . EPersonRegistration ) ;
137120 }
138121
139122 getRegisterRoute ( ) {
0 commit comments