-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat: show error Toastr for intranet users on SPCP forms #1397
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mantariksh
force-pushed
the
feat/intranet-detection
branch
2 times, most recently
from
March 17, 2021 09:55
55d090c
to
81f6115
Compare
mantariksh
force-pushed
the
feat/intranet-detection
branch
from
March 17, 2021 10:12
81f6115
to
7ea7c5c
Compare
mantariksh
force-pushed
the
feat/intranet-detection
branch
from
March 17, 2021 10:26
7ea7c5c
to
6fb03de
Compare
karrui
approved these changes
Mar 18, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
src/public/modules/forms/base/controllers/submit-form.client.controller.js
Show resolved
Hide resolved
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
SingPass/CorpPass do not work on the intranet due to an issue with SIS cookies, but nothing in the UI alerts users to this. When they attempt to log in to SingPass/CorpPass, everything seems to be successful, but when they are redirected back to the form, they are not logged in.
Solution
Show a permanent Toastr when users access a SPCP/MyInfo form from the intranet.
Detection of requests from the intranet was implemented by reading in a list of intranet IPs from a static file, which must be transferred into the server.
In addition, the opportunity was taken to log intranet usage for analytics purposes.
Other changes
In the
createReqMeta
utility function, we use thereq.url
property to log the URL of the request. However, this does not work well with Express Router, as only the path after the router is logged. This is why e.g. forhandleEmailSubmission
,meta.url
in our logs looks like this:Notice that the
/v2/submissions/email
prefix is missing.Hence this was changed to use
req.baseUrl + req.path
, andreq.originalUrl
was added to capture any query parameters.Screenshots
Tests
INTRANET_IP_LIST_PATH
env var has been added in production