Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show correct error message for e-service ID validation #1722

Merged
merged 5 commits into from
Apr 26, 2021

Conversation

mantariksh
Copy link
Contributor

@mantariksh mantariksh commented Apr 26, 2021

Problem

Singpass e-service ID validation relies on parsing the HTML of the login page. The login page recently added a semicolon in the line showing the error code, resulting in the FormSG server returning null for the error code. This causes the frontend to show an error message saying "Could not connect SingPass to validate the e-service ID", instead of showing that the e-service ID is invalid.

Solution

Add the semicolon to the parsing code, and also make the comparison case-insensitive.

Screenshots

Before

Screenshot 2021-04-26 at 10 47 52 AM

After

image

Tests

  • Attempt to activate a Singpass form with an invalid e-service ID. The error message should say that Singpass returned error code 138.
  • Repeat above test for MyInfo form.

Copy link
Contributor

@karrui karrui left a comment

Choose a reason for hiding this comment

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

lgtm

src/app/modules/spcp/spcp.service.ts Outdated Show resolved Hide resolved
@mantariksh mantariksh merged commit 9d7647d into develop Apr 26, 2021
@mantariksh mantariksh deleted the fix/esrvcid-code branch May 18, 2021 08:29
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