Skip to content

Commit

Permalink
unset attemptedTransition on invalidation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow committed Aug 19, 2020
1 parent 6b97dea commit 16ef3c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ember-simple-auth/addon/internal-session.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default ObjectProxy.extend(Evented, {

invalidate() {
this._busy = true;
this.set('attemptedTransition', null);

if (!this.get('isAuthenticated')) {
this._busy = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,14 @@ describe('InternalSession', () => {
await session.authenticate('authenticator:test');
});

it('unsets the attemptedTransition', function() {
session.set('attemptedTransition', { some: 'transition' });
session.invalidate();

expect(session.get('attemptedTransition')).to.be.null;
});


describe('when invalidate gets called with additional params', function() {
beforeEach(function() {
sinon.spy(authenticator, 'invalidate');
Expand Down

0 comments on commit 16ef3c0

Please sign in to comment.