AuthInterceptor changed

This commit is contained in:
Julius Gruber
2019-06-19 14:24:38 +02:00
parent 4bcc54befd
commit 17e2918721
2 changed files with 3 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
import {Observable, of as observableOf, throwError as observableThrowError} from 'rxjs';
import {catchError, filter, map} from 'rxjs/operators';
import {catchError, filter, map, tap} from 'rxjs/operators';
import {Injectable, Injector} from '@angular/core';
import {
HttpErrorResponse,
@@ -131,6 +131,7 @@ export class AuthInterceptor implements HttpInterceptor {
// Pass on the new request instead of the original request.
return next.handle(newReq).pipe(
tap((response) => console.log('next.handle: ', response)),
map((response) => {
// Intercept a Login/Logout response
if (response instanceof HttpResponse && this.isSuccess(response) && (this.isLoginResponse(response) || this.isLogoutResponse(response))) {

View File

@@ -20,7 +20,6 @@ import {CoreState} from '../../core/core.reducers';
import {isNotEmpty} from '../empty.util';
import {fadeOut} from '../animations/fade';
import {AuthService} from '../../core/auth/auth.service';
import {HttpClient} from '@angular/common/http';
/**
* /users/sign-in
@@ -104,7 +103,7 @@ export class LogInComponent implements OnDestroy, OnInit {
private authService: AuthService,
private formBuilder: FormBuilder,
private store: Store<CoreState>,
private http: HttpClient
) {
}