Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
trev-dev committed Jun 18, 2024
1 parent 15a12af commit 16e96b8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async function addLoginPassportUse(discovery, strategyName, callbackURI, kc_idp_
const parseJwt = (token) => {
try {
return JSON.parse(atob(token.split('.')[1]));
} catch (e) {
} catch {
return null;
}
};
Expand Down
6 changes: 3 additions & 3 deletions backend/src/components/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import axios from 'axios';
import jsonwebtoken from 'jsonwebtoken';
import qs from 'querystring';
import HttpStatus from 'http-status-codes';
import lodash from 'lodash'
import lodash from 'lodash';

import { ApiError } from './error.js';
import { getOidcDiscovery, prettyStringify } from './utils.js';
Expand Down Expand Up @@ -81,8 +81,8 @@ export async function refreshJWT(req, _res, next) {

// Get new JWT and Refresh Tokens and update the request
const result = await renew(req.user.refreshToken);
req.user.jwt = result.jwt; // eslint-disable-line require-atomic-updates
req.user.refreshToken = result.refreshToken; // eslint-disable-line require-atomic-updates
req.user.jwt = result.jwt;
req.user.refreshToken = result.refreshToken;
} else {
log.verbose('refreshJWT', 'Cannot refresh JWT token');
delete req.user;
Expand Down
6 changes: 3 additions & 3 deletions backend/src/components/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ async function sendVerificationEmail(accessToken, emailAddress, requestId, ident
const payload = {
SCOPE: 'VERIFY_EMAIL'
};
reqData.jwtToken = await generateJWTToken(requestId, emailAddress, 'VerifyEmailAPI', 'HS256', payload);
reqData.jwtToken = generateJWTToken(requestId, emailAddress, 'VerifyEmailAPI', 'HS256', payload);
return await postData(accessToken, reqData, url, correlationID);
} catch (e) {
throw new ServiceError('sendVerificationEmail error', e);
Expand Down Expand Up @@ -430,7 +430,7 @@ function beforeUpdateRequestAsInitrev(request, requestType) {
throw new ConflictStateError(`Current ${requestType} Email Verification Status: ` + request.emailVerified);
}

request.initialSubmitDate = localDateTime.now().toString();
request.initialSubmitDate = LocalDateTime.now().toString();
request.emailVerified = EmailVerificationStatuses.VERIFIED;

return request;
Expand Down Expand Up @@ -506,7 +506,7 @@ async function updateRequestStatus(accessToken, requestID, requestStatus, reques

let request = beforeUpdate(data, requestType);
request[`${requestType}StatusCode`] = requestStatus;
request.statusUpdateDate = localDateTime.now().toString();
request.statusUpdateDate = LocalDateTime.now().toString();

data = await putData(accessToken, request, endpoint, correlationID);
data.digitalID = null;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/components/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,5 @@ export function formatCommentTimestamp(time) {
}

export function prettyStringify(obj, indent = 2) {
return JSON.stringify(obj, null, indent)
return JSON.stringify(obj, null, indent);
}
2 changes: 1 addition & 1 deletion backend/src/messaging/message-subscriber.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function init() {
try {
connection = await nats.connect(natsOptions);
listenForEvents();
connection.closed().then(err => log.error(`connection closed ${err ? "with error: " + err.message : ""}`));
connection.closed().then(err => log.error(`connection closed ${err ? 'with error: ' + err.message : ''}`));
} catch (e) {
log.error(`error ${e}`);
}
Expand Down

0 comments on commit 16e96b8

Please sign in to comment.