mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-10 03:23:07 +00:00
AuthInterceptor changed
This commit is contained in:
@@ -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))) {
|
||||
|
@@ -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
|
||||
|
||||
) {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user