Skip to content

Add error pages for one login journey#2071

Merged
stephencdaly merged 3 commits intomainfrom
add-error-pages-for-one-login-journey
Apr 30, 2026
Merged

Add error pages for one login journey#2071
stephencdaly merged 3 commits intomainfrom
add-error-pages-for-one-login-journey

Conversation

@stephencdaly
Copy link
Copy Markdown
Contributor

@stephencdaly stephencdaly commented Apr 29, 2026

What problem does this pull request solve?

Trello card: https://trello.com/c/tKtA1VPQ/2858-create-integration-with-one-login

Add error pages for the following scenarios:

The auth details are missing or there is an unexpected error authorising with One Login

Screenshot 2026-04-29 at 16 57 51

The user's session has been lost when they're returned to us from One Login

Screenshot 2026-04-29 at 17 01 45

The user's session has been lost after they've been logged out when they submit their form

In this case, rather than showing an error, show a generic success page without the form details as the user's form will still have been submitted and we should have sent them an email with their answers.

Screenshot 2026-04-29 at 17 03 46

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Base automatically changed from log-user-out-when-they-submit to main April 29, 2026 16:14
@stephencdaly stephencdaly marked this pull request as ready for review April 29, 2026 16:20
@stephencdaly stephencdaly force-pushed the add-error-pages-for-one-login-journey branch from 511cf42 to 3ded715 Compare April 30, 2026 08:27
@stephencdaly
Copy link
Copy Markdown
Contributor Author

@StephenGill could you double-check the content is correct in this one please?

@StephenGill
Copy link
Copy Markdown

Copy looks good to me

Comment thread app/views/errors/auth_error.html.erb Outdated
Comment thread app/views/errors/return_from_one_login_session_missing.html.erb Outdated
Copy link
Copy Markdown
Contributor

@DavidBiddle DavidBiddle left a comment

Choose a reason for hiding this comment

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

All looks good aside from those HTML issues raised above - I've tested locally and everything else works as expected

This page has a link to go back to the copy of your answers page so
the user can try again if they wish.
Render a dedicated error page when we are returned from One Login and
we don't know which form to return the user to because their session
is missing.
We log the user out from One Login if they've opted to receive a copy
of their answers when they submit the form. This involves redirecting
them to One Login, and then they are returned to a URL on our service
which is not form specific. We store details of the form they
submitted in the session so we know where to return them to.

If somehow the user's session is lost when they're returned to us from
One Login, we still want to tell the user that their form has been
submitted, even if we don't know which form. Render a generic page
and log an error in this case.
@stephencdaly stephencdaly force-pushed the add-error-pages-for-one-login-journey branch from 3ded715 to 602e2f7 Compare April 30, 2026 15:52
@github-actions
Copy link
Copy Markdown
Contributor

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2071.submit.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@stephencdaly stephencdaly added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit aae775e Apr 30, 2026
3 checks passed
@stephencdaly stephencdaly deleted the add-error-pages-for-one-login-journey branch April 30, 2026 16:08
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.

3 participants