diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2019-08-21 12:31:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-21 12:31:12 +0200 |
commit | 6d20876eb2aae5cb2269c7551e7a4f43e7a31222 (patch) | |
tree | 874fc4837b6bb425add34b154ad5ee03a782764f /core | |
parent | dd02920aedc63e89c8c8cf2e2c41344954bac08c (diff) | |
parent | 9c4c5ee8187f169d4d915b9bc84988cca2f6619d (diff) | |
download | nextcloud-server-6d20876eb2aae5cb2269c7551e7a4f43e7a31222.tar.gz nextcloud-server-6d20876eb2aae5cb2269c7551e7a4f43e7a31222.zip |
Merge pull request #16782 from nextcloud/fix/16729/stop-if-encrypted-token-null
Stop if there is no encrypted token
Diffstat (limited to 'core')
-rw-r--r-- | core/Controller/LostController.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index dcdafaa408c..49f015d511d 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -194,8 +194,12 @@ class LostController extends Controller { throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); } + $encryptedToken = $this->config->getUserValue($userId, 'core', 'lostpassword', null); + if ($encryptedToken === null) { + throw new \Exception($this->l10n->t('Couldn\'t reset password because the token is invalid')); + } + try { - $encryptedToken = $this->config->getUserValue($userId, 'core', 'lostpassword', null); $mailAddress = !is_null($user->getEMailAddress()) ? $user->getEMailAddress() : ''; $decryptedToken = $this->crypto->decrypt($encryptedToken, $mailAddress.$this->config->getSystemValue('secret')); } catch (\Exception $e) { |