-
Notifications
You must be signed in to change notification settings - Fork 303
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
Maryia/Fix: Hide URL query params before sending to 3rd parties #5666
Maryia/Fix: Hide URL query params before sending to 3rd parties #5666
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
16d04c0
to
06f4413
Compare
Codecov Report
@@ Coverage Diff @@
## master #5666 +/- ##
==========================================
- Coverage 20.38% 20.37% -0.01%
==========================================
Files 1290 1290
Lines 29290 29299 +9
Branches 4944 4945 +1
==========================================
Hits 5970 5970
- Misses 23003 23012 +9
Partials 317 317
Continue to review full report at Codecov.
|
setTimeout(() => { | ||
// timeout is needed to get the token (code) from the URL before we hide it from the URL | ||
// and from LiveChat that gets the URL from Window, particularly when initialized via HTML script on mobile | ||
history.replaceState(null, null, window.location.search.replace(/&?code=[^&]*/i, '')); |
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.
since query params is seperated by &
, the &
before code is always existed, so why do we need to make it optional?
history.replaceState(null, null, window.location.search.replace(/&?code=[^&]*/i, '')); | |
history.replaceState(null, null, window.location.search.replace(/&code=[^&]*/i, '')); |
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.
@mahdiyeh-fs because we need to include a case when the code
query would be the first one on the list of query params, i.e. standing right after the '?' in the url 🙂
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
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…istory state (deriv-com#5666) Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
…istory state (deriv-com#5666) Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
Changes:
Please include a summary of the change and which issue is fixed below:
When you need to add unit test
When you need to add integration test
Test coverage checklist (for reviewer)
Type of change