diff options
author | Christoph Wurst <christoph@owncloud.com> | 2016-06-21 10:23:50 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@owncloud.com> | 2016-06-21 10:24:25 +0200 |
commit | b805908dca5cd4daf9f56bc140bbed48e067d573 (patch) | |
tree | 9c9bee8639d269b80985621c873163b5803a6a8b /lib/private/User | |
parent | 0e575c7eeadc6c8eb11b0be2ed1d39cdcf6cfcb8 (diff) | |
download | nextcloud-server-b805908dca5cd4daf9f56bc140bbed48e067d573.tar.gz nextcloud-server-b805908dca5cd4daf9f56bc140bbed48e067d573.zip |
update session token password on user password change
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Session.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 4e9c827448d..fe1835b3e55 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -676,4 +676,21 @@ class Session implements IUserSession, Emitter { setcookie('oc_remember_login', '', time() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); } + /** + * Update password of the browser session token if there is one + * + * @param string $password + */ + public function updateSessionTokenPassword($password) { + try { + $sessionId = $this->session->getId(); + $token = $this->tokenProvider->getToken($sessionId); + $this->tokenProvider->setPassword($token, $sessionId, $password); + } catch (SessionNotAvailableException $ex) { + // Nothing to do + } catch (InvalidTokenException $ex) { + // Nothing to do + } + } + } |