fix/df-870: Redirects to latest link when old link#1147
Conversation
alexluckett
left a comment
There was a problem hiding this comment.
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
src/server/routes/save-and-exit.js
Outdated
| error.data?.payload?.custom?.latestId ?? | ||
| error.output.payload?.custom?.latestId |
There was a problem hiding this comment.
surely it's one or the other, not both?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Fixed the test now
| ) | ||
| }) | ||
|
|
||
| test('/rthrows if trying to redirect to latest in group, but none found', async () => { |
| ) | ||
| }) | ||
|
|
||
| test('/route forwards correctly on magic link consumed but redirects to latest link', async () => { |
|



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.