Skip to content

Oauth endpoint surge token deletion #1270

Ben requested to merge fix/logout-surge-token-deletion-1270 into master

Summary

Old mr !436 (closed) Closes #1270

Currently on the mobile app if you log into one account, then log out and into a different account, you will still receive push notifications for the first account.

This is because the Surge tokens (used for push notifications) that we use on the backend are not deleted on logout.

Steps

Video https://streamable.com/979cr

This is not the most straightforward feature to test, you will need to be set up on postman, and need to use kubectl exec -it to check Cassandra on the review site.

  1. Open up Postman.
  2. Set up a set of environmental variables that point to this sandbox. For more information see here: https://developers.minds.com/docs/walk-throughs/postman/
  3. Navigate to POST v2 oauth token
  4. Send the request - it will return your token.
  5. COPY the token to a text editor, keep it handy.
  6. On postman head over to POST api v1 notifications.
  7. In the params, replace the token with your token. Hit send.

This should set the Surge token in Cassandra, so lets check.

  1. Get your user GUID (loading your channel on sandbox, watch the XHRs, filter channel, and get your GUID from the response)
  2. kubectl into the container
  3. Open cassandra (kubectl exec -it cassandra-0 cqlsh)
  4. Run select * from minds.entities where key='1017892315210977294' AND column1='surge_token';, replacing my GUID with your own.
  5. There should be a value for the surge token.
  6. Now go to DELETE v2 oauth token, click the Auth tab, and replace the bearer token with your own from your text editor.
  7. Hit send, it should return a 200 with no body
  8. Re-run the cassandra command. Surge token should be gone.

Regression Scope

Changes v Impact

  • Session\Manager - limited to the destroy functionality, so would affect anything that destroys a session (e.g. logging out).
  • Entities\User - added functions and an exported value, I don't foresee any issues here.
Edited by Ben

Merge request reports

Loading