Skip to content

Commit

Permalink
fix: hoodie.account.isSignedIn() returns true in “signout" event hand…
Browse files Browse the repository at this point in the history
…ler (#99)
  • Loading branch information
dsims00 authored and gr2m committed Jun 6, 2016
1 parent df9973b commit d0160b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 3 additions & 1 deletion lib/sign-out.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ function signOut (state) {
cacheKey: state.cacheKey
})

state.emitter.emit('signout', clone(state.account))
var accountClone = clone(state.account)

delete state.account

state.emitter.emit('signout', accountClone)

var postHooks = []

// note: the `pre:signout` & `post:signout` events are not considered public
Expand Down
7 changes: 1 addition & 6 deletions test/integration/sign-out-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ var Account = require('../../index')

var baseURL = 'http://localhost:3000'

// prepared test for https://github.com/hoodiehq/camp/issues/9
// 1. replace `test.skip` with just `test`
// 2. run `$ node test/integration/sign-out-test.js`
// 3. you should see "not ok 1 should be equal"
// 4. remove all comments and commit change with "test: signout event timing hoodiehq/camp#9"
test.skip('sign out', function (t) {
test('sign out', function (t) {
t.plan(1)

// simulate signed in user
Expand Down

0 comments on commit d0160b3

Please sign in to comment.