Skip to content
Permalink
Browse files

Set authentication provider for stateless authentication too.

  • Loading branch information...
ADmad committed Dec 2, 2015
1 parent bfc9cfb commit f1f7c3f1b4ee1393a0d3034bd5ef2f26dd6f58d7
@@ -696,6 +696,7 @@ protected function _getUser()
foreach ($this->_authenticateObjects as $auth) {
$result = $auth->getUser($this->request);
if (!empty($result) && is_array($result)) {
$this->_authenticationProvider = $auth;
$this->storage()->write($result);
return true;
}
@@ -1083,6 +1083,11 @@ public function testStatelessAuthWorksWithUser()
$result = $this->Auth->user();
$this->assertEquals('mariano', $result['username']);
$this->assertInstanceOf(
'Cake\Auth\BasicAuthenticate',
$this->Auth->authenticationProvider()
);
$result = $this->Auth->user('username');
$this->assertEquals('mariano', $result);
$this->assertFalse(isset($_SESSION));

0 comments on commit f1f7c3f

Please sign in to comment.
You can’t perform that action at this time.