queryParams: getPersistableQueryParamsWithoutOktaParams()

in src/server/routes/register.ts [429:457]


		queryParams: getPersistableQueryParamsWithoutOktaParams(
			res.locals.queryParams,
		),
	});
};

/**
 * @name oktaIdxCreateAccount
 * @description Attempt to create an account for the user using the Okta IDX API, and use passcodes to verify the user.
 *
 * NB. This currently only supports creating account for new users, and verifying them with a passcode.
 * Currently if an existing user who tries to register, will fall back to the legacy Okta registration flow, where they
 * will be sent a link instead to either sign in or reset their password.
 * However the behaviour of this flow should be the same regardless of whether the user is new or existing, in either case
 * they should be sent a passcode to verify their account (for new users), or sign in (existing users).
 * TODO: This flow SHOULD be updated to support existing users in the future, once we have finished implementing passcodes
 * for sign in and reset password flows.
 *
 * @param {Request} req - Express request object
 * @param {ResponseWithRequestState} res - Express response object
 * @returns {Promise<void | ResponseWithRequestState>}
 */
const oktaIdxCreateAccount = async (
	req: Request,
	res: ResponseWithRequestState,
) => {
	const { email = '' } = req.body;

	const {