diff --git a/src/components/FormStart/index.jsx b/src/components/FormStart/index.jsx
index f8f771f90..e229c9d8d 100644
--- a/src/components/FormStart/index.jsx
+++ b/src/components/FormStart/index.jsx
@@ -105,6 +105,10 @@ const FormStart = ({form, submission, onFormStart, onDestroySession, initialData
);
}
+ const extraNextParams = initialDataReference
+ ? {initial_data_reference: initialDataReference}
+ : {};
+
return (
@@ -121,11 +125,7 @@ const FormStart = ({form, submission, onFormStart, onDestroySession, initialData
isAuthenticated={isAuthenticated}
/>
) : (
-
+
)}
diff --git a/src/components/FormStart/tests.spec.jsx b/src/components/FormStart/tests.spec.jsx
index bed48cc90..72ab89450 100644
--- a/src/components/FormStart/tests.spec.jsx
+++ b/src/components/FormStart/tests.spec.jsx
@@ -115,3 +115,26 @@ it('Form start page with initial_data_reference', async () => {
'https://openforms.nl/auth/form-name/digid/start?next=http%3A%2F%2Flocalhost%2F%3F_start%3D1%26initial_data_reference%3D1234'
);
});
+
+it('Form start page without initial_data_reference', async () => {
+ useQuery.mockReturnValue(new URLSearchParams());
+ const onFormStart = jest.fn();
+ const onDestroySession = jest.fn();
+
+ render(
+
+
+
+ );
+
+ const loginLink = await screen.findByRole('link', {name: 'Login with DigiD'});
+ expect(loginLink).toHaveAttribute(
+ 'href',
+ 'https://openforms.nl/auth/form-name/digid/start?next=http%3A%2F%2Flocalhost%2F%3F_start%3D1'
+ );
+});