Skip to content

Commit

Permalink
Fix password change in cookie auth
Browse files Browse the repository at this point in the history
We can not set same cookie twice, so we have to avoid sending auth
cookie when we're about to change the password.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Aug 2, 2016
1 parent cdcf74a commit 38b7318
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libraries/plugins/auth/AuthenticationCookie.php
Expand Up @@ -492,7 +492,11 @@ public function storeUserCredentials()
$this->storeUsernameCookie($cfg['Server']['user']);

// Duration = as configured
$this->storePasswordCookie($cfg['Server']['password']);
// Do not store password cookie on password change as we will
// set the cookie again after password has been changed
if (! isset($_POST['change_pw'])) {
$this->storePasswordCookie($cfg['Server']['password']);
}

// Set server cookies if required (once per session) and, in this case,
// force reload to ensure the client accepts cookies
Expand Down

0 comments on commit 38b7318

Please sign in to comment.