diff --git a/package-lock.json b/package-lock.json index a6a1a82..f6a5122 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12291,9 +12291,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sartography-workflow-lib": { - "version": "0.0.177", - "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.177.tgz", - "integrity": "sha512-lR+3MljVyWj6hPJ/a3bxKhBaZ0CoK5WxNVq6Xb3Qo6CiCbuzG/CJiE3jcS1fsgPDNyLHzCKlwpNH6z95pfPI2w==" + "version": "0.0.180", + "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.180.tgz", + "integrity": "sha512-d/ePxdkeIX/ZW3Sp5NIkZsitxRxS560PWorOd9RaojyJtMks2EgCwuN0Gs18NkT0Qrvk7fJHKYYV89k0/H0djQ==" }, "sass": { "version": "1.23.3", diff --git a/package.json b/package.json index d8f316e..5ac3f7f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "ngx-file-drop": "^8.0.8", "ngx-markdown": "^9.0.0", "rxjs": "~6.5.4", - "sartography-workflow-lib": "^0.0.177", + "sartography-workflow-lib": "^0.0.180", "tslib": "^1.11.1", "uuid": "^7.0.2", "zone.js": "^0.10.3" diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5c9b4e3..afa3b86 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -23,6 +23,7 @@ import {FormlyModule} from '@ngx-formly/core'; import { AppEnvironment, AuthInterceptor, + ErrorInterceptor, SartographyFormsModule, SartographyPipesModule, SartographyWorkflowLibModule @@ -46,12 +47,12 @@ import {FooterComponent} from './footer/footer.component'; import {HomeComponent} from './home/home.component'; import {ModelerComponent} from './modeler/modeler.component'; import {NavbarComponent} from './navbar/navbar.component'; +import {ProtocolBuilderComponent} from './protocol-builder/protocol-builder.component'; +import {ReferenceFilesComponent} from './reference-files/reference-files.component'; import {SignInComponent} from './sign-in/sign-in.component'; import {SignOutComponent} from './sign-out/sign-out.component'; import {WorkflowSpecCardComponent} from './workflow-spec-card/workflow-spec-card.component'; import {WorkflowSpecListComponent} from './workflow-spec-list/workflow-spec-list.component'; -import { ProtocolBuilderComponent } from './protocol-builder/protocol-builder.component'; -import { ReferenceFilesComponent } from './reference-files/reference-files.component'; @Injectable() export class ThisEnvironment implements AppEnvironment { @@ -131,6 +132,7 @@ export class ThisEnvironment implements AppEnvironment { {provide: 'APP_ENVIRONMENT', useClass: ThisEnvironment}, {provide: APP_BASE_HREF, useValue: environment.baseHref}, {provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true}, + {provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true}, ] }) export class AppModule { diff --git a/src/app/navbar/navbar.component.ts b/src/app/navbar/navbar.component.ts index 80a818f..17db5ce 100644 --- a/src/app/navbar/navbar.component.ts +++ b/src/app/navbar/navbar.component.ts @@ -39,14 +39,6 @@ export class NavbarComponent { this._loadNavLinks(); }, error => { localStorage.removeItem('token'); - - if (this.environment.production) { - localStorage.setItem('prev_url', location.href); - const emptyUserParams: UserParams = { uid: null }; - this.api.redirectToLogin(location.origin + '/session', emptyUserParams); - } else { - this.api.openUrl('/'); - } }); } } diff --git a/src/app/sign-in/sign-in.component.ts b/src/app/sign-in/sign-in.component.ts index f8fcace..1a59087 100644 --- a/src/app/sign-in/sign-in.component.ts +++ b/src/app/sign-in/sign-in.component.ts @@ -71,8 +71,9 @@ export class SignInComponent implements OnInit { // For testing purposes, create a user to simulate login. if (!this.environment.production) { - localStorage.setItem('prev_url', location.href); - this.api.redirectToLogin(location.origin + '/session', this.model); + localStorage.setItem('prev_url', location.origin); + this.model.redirect_url = location.origin + '/session'; + this.api.redirectToLogin(this.model.redirect_url, this.model); } else { this.error = new Error('This feature does not work in production.'); }