From 0c39bbe7f32a6421fbd8582b829da93788d4b141 Mon Sep 17 00:00:00 2001 From: Mark Thomas Date: Thu, 18 Apr 2024 16:19:06 +0100 Subject: [PATCH] set session registration flag during alternate flow --- .../account-not-found/account-not-found-controller.ts | 2 ++ .../tests/account-not-found-controller.test.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/components/account-not-found/account-not-found-controller.ts b/src/components/account-not-found/account-not-found-controller.ts index f7fcfd890..3fbe7ea90 100644 --- a/src/components/account-not-found/account-not-found-controller.ts +++ b/src/components/account-not-found/account-not-found-controller.ts @@ -61,6 +61,8 @@ export function accountNotFoundPost( throw new BadRequestError(result.data.message, result.data.code); } + req.session.user.isAccountCreationJourney = true; + res.redirect( getNextPathAndUpdateJourney( req, diff --git a/src/components/account-not-found/tests/account-not-found-controller.test.ts b/src/components/account-not-found/tests/account-not-found-controller.test.ts index 162fa003c..b0721e336 100644 --- a/src/components/account-not-found/tests/account-not-found-controller.test.ts +++ b/src/components/account-not-found/tests/account-not-found-controller.test.ts @@ -78,6 +78,7 @@ describe("account not found controller", () => { await accountNotFoundPost(fakeService)(req, res); + expect(req.session.user.isAccountCreationJourney).to.be.true; expect(res.redirect).to.have.calledWith(PATH_NAMES.CHECK_YOUR_EMAIL); expect(fakeService.sendNotification).to.have.been.calledOnce; });