feat(event): authenticationFailure

This commit is contained in:
Julien Fontanet 2016-05-06 12:33:56 +02:00
parent a4dc965c23
commit 306d5d8fc7

View File

@ -63,9 +63,15 @@ export default class Xo extends JsonRpcWebSocketClient {
}
_signIn (credentials) {
return super.call('session.signIn', credentials).then((user) => {
this._user = user
this.emit('authenticated')
})
return super.call('session.signIn', credentials).then(
user => {
this._user = user
this.emit('authenticated')
},
error => {
this.emit('authenticationFailure', error)
throw error
}
)
}
}