Added log to interceptor

This commit is contained in:
Julius Gruber
2019-06-19 13:39:59 +02:00
parent 70c9050fad
commit 4bcc54befd
6 changed files with 49 additions and 2 deletions

View File

@@ -101,6 +101,8 @@ export class AuthInterceptor implements HttpInterceptor {
const token = authService.getToken(); const token = authService.getToken();
let newReq; let newReq;
console.log('intercept() request: ', req);
if (authService.isTokenExpired()) { if (authService.isTokenExpired()) {
authService.setRedirectUrl(this.router.url); authService.setRedirectUrl(this.router.url);
// The access token is expired // The access token is expired

View File

@@ -0,0 +1,3 @@
<p>
Shibboleth Login Page
</p>

View File

@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ShibbolethComponent } from './shibboleth.component';
describe('ShibbolethComponent', () => {
let component: ShibbolethComponent;
let fixture: ComponentFixture<ShibbolethComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ShibbolethComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ShibbolethComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'shibboleth',
templateUrl: './shibboleth.component.html',
styleUrls: ['./shibboleth.component.css']
})
export class ShibbolethComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}

View File

@@ -138,6 +138,7 @@ import { RoleDirective } from './roles/role.directive';
import { UserMenuComponent } from './auth-nav-menu/user-menu/user-menu.component'; import { UserMenuComponent } from './auth-nav-menu/user-menu/user-menu.component';
import { ClaimedTaskActionsReturnToPoolComponent } from './mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component'; import { ClaimedTaskActionsReturnToPoolComponent } from './mydspace-actions/claimed-task/return-to-pool/claimed-task-actions-return-to-pool.component';
import { ItemDetailPreviewFieldComponent } from './object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component'; import { ItemDetailPreviewFieldComponent } from './object-detail/my-dspace-result-detail-element/item-detail-preview/item-detail-preview-field/item-detail-preview-field.component';
import { ShibbolethComponent } from './log-in/shibboleth/shibboleth.component';
const MODULES = [ const MODULES = [
// Do NOT include UniversalModule, HttpModule, or JsonpModule here // Do NOT include UniversalModule, HttpModule, or JsonpModule here
@@ -338,7 +339,8 @@ const DIRECTIVES = [
...COMPONENTS, ...COMPONENTS,
...DIRECTIVES, ...DIRECTIVES,
...ENTRY_COMPONENTS, ...ENTRY_COMPONENTS,
...SHARED_ITEM_PAGE_COMPONENTS ...SHARED_ITEM_PAGE_COMPONENTS,
ShibbolethComponent
], ],
providers: [ providers: [
...PROVIDERS ...PROVIDERS