Skip to content

fix/df-870: Redirects to latest link when old link#1147

Merged
alexluckett merged 4 commits intomainfrom
fix/df-870-reuse
Apr 2, 2026
Merged

fix/df-870: Redirects to latest link when old link#1147
alexluckett merged 4 commits intomainfrom
fix/df-870-reuse

Conversation

@jbarnsley10
Copy link
Copy Markdown
Contributor

@jbarnsley10 jbarnsley10 commented Apr 1, 2026

Can re-use old link even though it is marked as 'consumed'. It looks for the most recent non-consumed record of the save-and-exit group and redirects.

@jbarnsley10 jbarnsley10 requested a review from alexluckett April 1, 2026 13:47
Copy link
Copy Markdown
Contributor

@alexluckett alexluckett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just had some updated content from Laura, can we tweak the landing page to say:

"Enter the most recent security answer to your security question to retrieve your information and continue with your form. You have 3 attempts to enter the correct answer."

bold emphasis is mine to show what's new, it's not needed on the final copy though

Comment on lines +276 to +277
error.data?.payload?.custom?.latestId ??
error.output.payload?.custom?.latestId
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely it's one or the other, not both?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only cause the unit test to fill 'output' whereas the real API call fills 'data'. Wasn't exactly sure why I couldn't force it in the unit test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the test now

)
})

test('/rthrows if trying to redirect to latest in group, but none found', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\r mistake?

)
})

test('/route forwards correctly on magic link consumed but redirects to latest link', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ mistake?

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@alexluckett alexluckett merged commit 38bc1da into main Apr 2, 2026
9 checks passed
@alexluckett alexluckett deleted the fix/df-870-reuse branch April 2, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants