wellcomecollection / identity

Identity services for Wellcome Collection users
MIT License
0 stars 2 forks source link

Improve the error message when somebody has multiple patron records #381

Closed alexwlchan closed 1 year ago

alexwlchan commented 1 year ago

Last night we saw a smattering of errors when somebody tried to sign up. The underlying issue wasn't that they already had a Sierra account (which we already handle correctly); it's that they had two. This should be impossible – we cleaned up all the duplicate accounts before launching the new user sign-in, and Auth0 should prevent this from happening – but it did, and we give a less than helpful error:

Screenshot 2022-10-04 at 08 23 11

This patch adds a DuplicateUsers response status from the getRecordByEmail() method on the Sierra client, and then we can respond to it with a more actionable error message:

Screenshot 2022-10-04 at 08 22 12

This copy is based on a similar error which already works correctly on the sign-in screen:

Screenshot 2022-10-04 at 08 22 03

I don't know why one error is in a red box and one is in inline text and I'm not going to spend the time to work it out; this should help the handful of users who are affected by this issue – and possibly prompt LE&E to work out where this is coming from.