Skip to content

Commit

Permalink
skip if /session/* route
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Aug 15, 2023
1 parent 2cd89f7 commit cc36e82
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ export function checkCountryQuestionAnswered(req: Request, res: Response, next:
export async function checkIsExistingList(req: Request, res: Response, next: NextFunction) {
const { serviceType } = req.params;
const session = req.session.application ?? {};

if (session.isInitialisedSession === true) {
logger.info(
`checkIsExistingList: ${req.url} - User entered through /application/session - country check not required`
);
next();
return;
}

const { country, type } = session;
const sessionTypeMatchesReqType = serviceType === type;

Expand Down

0 comments on commit cc36e82

Please sign in to comment.