accounts-js / accounts

Fullstack authentication and accounts-management for Javascript.
https://www.accountsjs.com/
MIT License
1.5k stars 141 forks source link

fix(client): invalidate session when stopping impersonation #1097

Closed blessanabraham closed 3 years ago

blessanabraham commented 3 years ago

The session created when impersonating another user is is not invalidated when the client stops impersonation. This PR adds a call to logout to properly invalidate the session before restoring the original tokens from storage.

Fixes: #1096

codecov[bot] commented 3 years ago

Codecov Report

Merging #1097 (5c1c88a) into master (e242169) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1097   +/-   ##
=======================================
  Coverage   95.44%   95.44%           
=======================================
  Files          85       85           
  Lines        1908     1909    +1     
  Branches      413      413           
=======================================
+ Hits         1821     1822    +1     
  Misses         85       85           
  Partials        2        2           
Impacted Files Coverage Δ
packages/client/src/accounts-client.ts 98.90% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e242169...5c1c88a. Read the comment docs.

pradel commented 3 years ago

Thanks for the fix!