Skip to content

Commit

Permalink
BAU: test sonarcloud quality gate
Browse files Browse the repository at this point in the history
  • Loading branch information
dbes-gds committed May 21, 2024
1 parent b8b7608 commit 5ddc40c
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Request, Response } from "express";
import { getNextPathAndUpdateJourney } from "../common/constants";
import { USER_JOURNEY_EVENTS } from "../common/state-machine/state-machine";

export async function signInOrCreateGet(
req: Request,
res: Response
): Promise<void> {
req.session.user.isAccountCreationJourney = false;
req.session.user.isPasswordResetJourney = false;
req.session.user.isSignInJourney = false;
if (req.query.redirectPost) {
return await signInOrCreatePost(req, res);
}
res.render("sign-in-or-create/index.njk", {
serviceType: req.session.client.serviceType,
});
}

export async function signInOrCreatePost(
req: Request,
res: Response
): Promise<void> {
res.redirect(
await getNextPathAndUpdateJourney(
req,
req.path,
req.body.optionSelected === "create"
? USER_JOURNEY_EVENTS.CREATE_NEW_ACCOUNT
: USER_JOURNEY_EVENTS.SIGN_IN,
null,
res.locals.sessionId
)
);
}

0 comments on commit 5ddc40c

Please sign in to comment.