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

Use account information instead of access token for local storage #7703

Merged
merged 1 commit into from
Jan 29, 2019

Conversation

asheemmamoowala
Copy link
Contributor

Launch Checklist

Closes #7602

Access tokens are not always permanent and some apps may rotate tokens quite frequently. In these cases the turnstile event is being sent more frequently than is necessary, and access token based local storage is being polluted.

This PR changes the way the turnstile event is triggered, and it's information stored, by basing it on the account owner instead of the encoded token.

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • manually test the debug page

cc @mick @amyjin7

if (isLocalStorageAvailable) {
try {
window.localStorage.setItem(uuidKey, this.anonId);
if (this.eventData.lastSuccess) {
if (Object.keys(this.eventData).length >= 1) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this change here? Isn't lastSuccess still set in the same place?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is unrelated, but it ensures that state is saved even if it doesn't include lastSuccess

@asheemmamoowala asheemmamoowala merged commit 439c939 into master Jan 29, 2019
@asheemmamoowala asheemmamoowala deleted the fix-7602 branch January 29, 2019 19:49
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