Skip to content

Commit

Permalink
fix(admin-ui): Correctly handle missing error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Oct 14, 2020
1 parent c52a258 commit aa80092
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class DefaultInterceptor implements HttpInterceptor {
// inside the body of the response.
const graqhQLErrors = response.body.errors;
if (graqhQLErrors && Array.isArray(graqhQLErrors)) {
const firstCode: string = graqhQLErrors[0].extensions.code;
const firstCode: string = graqhQLErrors[0]?.extensions?.code;
if (firstCode === 'FORBIDDEN') {
this.authService.logOut().subscribe(() => {
if (!window.location.pathname.includes('login')) {
Expand Down

0 comments on commit aa80092

Please sign in to comment.