Skip to content

Commit

Permalink
Fix record removal from session storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed May 28, 2015
1 parent 0f36379 commit fa2be1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Auth/Storage/SessionStorage.php
Expand Up @@ -100,7 +100,7 @@ public function set(array $user)
*/
public function remove()
{
unset($this->_user);
$this->_user = null;

$this->_session->delete($this->_config['key']);
$this->_session->renew();
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/Controller/Component/AuthComponentTest.php
Expand Up @@ -199,14 +199,14 @@ public function testAuthorizeFalse()
$event = new Event('Controller.startup', $this->Controller);
$Users = TableRegistry::get('Users');
$user = $Users->find('all')->hydrate(false)->first();
$this->Auth->session->write('Auth.User', $user);
$this->Controller->Auth->storage()->set($user);
$this->Controller->Auth->config('userModel', 'Users');
$this->Controller->Auth->config('authorize', false);
$this->Controller->request->addParams(Router::parse('auth_test/add'));
$result = $this->Controller->Auth->startup($event);
$this->assertNull($result);

$this->Auth->session->delete('Auth');
$this->Controller->Auth->storage()->remove();
$result = $this->Controller->Auth->startup($event);
$this->assertTrue($event->isStopped());
$this->assertInstanceOf('Cake\Network\Response', $result);
Expand Down

0 comments on commit fa2be1e

Please sign in to comment.