Skip to content

Commit

Permalink
unset attemptedTransition on invalidation (#2234)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoow authored and Samanta de Barros committed Oct 16, 2020
1 parent b179acc commit 3502daa
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 3502daa

Please sign in to comment.