email: readEncryptedStateCookie()

in src/server/routes/register.ts [140:174]


					email: readEncryptedStateCookie(req)?.email,
				},
			}),
			pageTitle: 'Check Your Inbox',
		});
		res.type('html').send(html);
	},
);

router.post(
	'/register/email-sent/resend',
	handleRecaptcha,
	handleAsyncErrors(async (req: Request, res: ResponseWithRequestState) => {
		await OktaResendEmail(req, res);
	}),
);

router.post(
	'/register',
	handleRecaptcha,
	redirectIfLoggedIn,
	handleAsyncErrors(async (req: Request, res: ResponseWithRequestState) => {
		await OktaRegistration(req, res);
	}),
);

// Essentially the email-sent page, but for passcode registration
router.get('/register/code', (req: Request, res: ResponseWithRequestState) => {
	const state = res.locals;

	const encryptedState = readEncryptedStateCookie(req);

	if (encryptedState?.email && encryptedState.stateHandle) {
		const html = renderer('/register/email-sent', {
			requestState: mergeRequestState(state, {