summaryrefslogtreecommitdiffstats
path: root/core/Controller/LostController.php
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2019-08-18 19:58:50 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2019-08-18 19:58:50 +0200
commite32b2c4b762a126b504b863c258caa2d4b72213f (patch)
tree447b8ad06bf85f2d3ee336ae363b2b472382437b /core/Controller/LostController.php
parentb3880452bb9e33d10cac6da18a8e7ae673a5eff2 (diff)
downloadnextcloud-server-e32b2c4b762a126b504b863c258caa2d4b72213f.tar.gz
nextcloud-server-e32b2c4b762a126b504b863c258caa2d4b72213f.zip
Stop if there is no encrypted token
Fix Argument 1 passed to OC\Security\Crypto::decrypt() must be of the type string, null given Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/Controller/LostController.php')
-rw-r--r--core/Controller/LostController.php6
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) {