Skip to content

Commit

Permalink
Promise rejects handled in AuthenticationManager fixes voryx#27
Browse files Browse the repository at this point in the history
  • Loading branch information
mbonneau committed Sep 28, 2014
1 parent ba46568 commit 8d71877
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Thruway/Authentication/AuthenticationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function onSessionStart($session, $transport)
->then(
function () {
$this->setReady(true);
},
function () {
$this->setReady(false);
$this->getManager()->error("registration of registerAuthMethod failed.");
}
);
}
Expand Down Expand Up @@ -200,6 +204,10 @@ function ($res) use ($session, $msg) {
}
}
}
},
function () use ($session) {
$this->getManager()->error("onhello rejected the promise");
$session->abort("thruway.error.unknown");
}
);
$sentMessage = true;
Expand Down Expand Up @@ -287,6 +295,10 @@ function ($res) use ($session) {
} else {
$session->abort(new \stdClass(), "bad.login");
}
},
function () use ($session) {
$this->getManager()->error("onauthenticate rejected the promise");
$session->abort("thruway.error.unknown");
}
);
}
Expand Down

0 comments on commit 8d71877

Please sign in to comment.