Browse Source

refactor: improve code readability

pull/5060/head
mehmet-erim 6 years ago
parent
commit
dbd1944bed
  1. 8
      npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts

8
npm/ng-packs/packages/core/src/lib/strategies/auth-flow.strategy.ts

@ -3,7 +3,7 @@ import { Router } from '@angular/router';
import { Store } from '@ngxs/store'; import { Store } from '@ngxs/store';
import { AuthConfig, OAuthService } from 'angular-oauth2-oidc'; import { AuthConfig, OAuthService } from 'angular-oauth2-oidc';
import { Observable, of } from 'rxjs'; import { Observable, of } from 'rxjs';
import { switchMap } from 'rxjs/operators'; import { switchMap, tap } from 'rxjs/operators';
import { GetAppConfiguration } from '../actions/config.actions'; import { GetAppConfiguration } from '../actions/config.actions';
import { RestOccurError } from '../actions/rest.actions'; import { RestOccurError } from '../actions/rest.actions';
import { RestService } from '../services/rest.service'; import { RestService } from '../services/rest.service';
@ -87,10 +87,8 @@ export class AuthPasswordFlowStrategy extends AuthFlowStrategy {
issuer, issuer,
) )
.pipe( .pipe(
switchMap(() => { tap(() => this.oAuthService.logOut()),
this.oAuthService.logOut(); switchMap(() => this.store.dispatch(new GetAppConfiguration())),
return this.store.dispatch(new GetAppConfiguration());
}),
); );
} }

Loading…
Cancel
Save