Skip to content

Commit

Permalink
fix(authentication-service): fix token expiry err
Browse files Browse the repository at this point in the history
SFO-0
  • Loading branch information
samarpan-b committed Jul 20, 2020
1 parent de3ed1a commit 65d6386
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions services/authentication-service/src/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import {
FindRoute,
HttpErrors,
InvokeMethod,
InvokeMiddleware,
ParseParams,
Reject,
RequestContext,
RestBindings,
Send,
SequenceHandler,
InvokeMiddleware,
} from '@loopback/rest';
import {ILogger, LOGGER, SFCoreBindings} from '@sourceloop/core';
import {AuthenticateFn, AuthenticationBindings} from 'loopback4-authentication';
import {
AuthorizationBindings,
Expand All @@ -20,7 +21,6 @@ import {

import {AuthClient} from './models';
import {AuthUser} from './modules/auth';
import {LOGGER, ILogger, SFCoreBindings} from '@sourceloop/core';

const SequenceActions = RestBindings.SequenceActions;
const isJsonString = (str: string) => {
Expand Down Expand Up @@ -100,17 +100,17 @@ export class MySequence implements SequenceHandler {
);

const error = this._rejectErrors(err);
if (
// sonarignore:start
// eslint-disable-next-line @typescript-eslint/no-explicit-any
!(error.message && (error.message as any).name === 'TokenExpiredError')
// sonarignore:end
) {
error.message = this.i18n.__({
phrase: error.message || 'Some error occured. Please try again',
locale: process.env.LOCALE ?? 'en',
});
}
// if (
// // sonarignore:start
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
// !(error.message && (error.message as any).name === 'TokenExpiredError')
// // sonarignore:end
// ) {
error.message = this.i18n.__({
phrase: error.message || 'Some error occured. Please try again',
locale: process.env.LOCALE ?? 'en',
});
// }
this.reject(context, error);
} finally {
this.logger.info(
Expand Down

0 comments on commit 65d6386

Please sign in to comment.