Skip to content

Commit

Permalink
Migrate to latest Play version - addresses #92
Browse files Browse the repository at this point in the history
Fixes UI tests.
  • Loading branch information
resamsel committed Nov 9, 2020
1 parent d89c687 commit 06a3bde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ describe('Project Settings Update', () => {
cy.route('/api/project/*/keys*', 'fixture:johndoe/p1/keys');
cy.route('/api/project/*/messages*', 'fixture:johndoe/p1/messages');
cy.route('/api/project/*/members*', 'fixture:johndoe/p1/members');
cy.route('/api/project/*/activities*', 'fixture:johndoe/p1/activities');
cy.route('/api/activities/aggregated*', 'fixture:johndoe/p1/activities-aggregated');
cy.route('/api/activities*', 'fixture:johndoe/p1/activities');
});

it('should persist on save', () => {
Expand Down
8 changes: 4 additions & 4 deletions ui/apps/translatr/src/app/interceptors/auth.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
import { Inject, Injectable } from '@angular/core';
import { NavigationCancel, Router } from '@angular/router';
import { LOGIN_URL } from '@translatr/utils';
import { Observable, of } from 'rxjs';
import { catchError, filter, shareReplay } from 'rxjs/operators';
import { Observable, throwError } from 'rxjs';
import { catchError, filter, shareReplay, take } from 'rxjs/operators';

const HTTP_STATUS_BAD_REQUEST = 400;
const HTTP_STATUS_UNAUTHORIZED = 401;
Expand Down Expand Up @@ -74,7 +74,7 @@ export class AuthInterceptor implements HttpInterceptor {

case HTTP_STATUS_UNAUTHORIZED:
// Unauthorized, redirecting to login page
this.navigationCancelled$.subscribe(event =>
this.navigationCancelled$.pipe(take(1)).subscribe(event =>
this.router.navigate([this.loginUrl], {
queryParamsHandling: 'merge',
queryParams: { redirect_uri: `/ui${event.url}` }
Expand Down Expand Up @@ -107,7 +107,7 @@ export class AuthInterceptor implements HttpInterceptor {
break;
}

return of(err as any);
return throwError(err as any);
})
);
}
Expand Down

0 comments on commit 06a3bde

Please sign in to comment.