1
0
Fork 0
mirror of synced 2024-06-02 02:44:47 +12:00

Update account.php

This commit is contained in:
Bradley Schofield 2021-07-06 13:18:55 +01:00
parent 1a8ace0fb0
commit 4e2b05b87c

View file

@ -1481,7 +1481,7 @@ App::post('/v1/account/recovery')
throw new Exception('Invalid credentials. User is blocked', 401); // User is in status blocked
}
$expires = \time() + Auth::TOKEN_EXPIRATION_RECOVERY;
$expire = \time() + Auth::TOKEN_EXPIRATION_RECOVERY;
$secret = Auth::tokenGenerator();
$recovery = new Document([
@ -1490,7 +1490,7 @@ App::post('/v1/account/recovery')
'userId' => $profile->getId(),
'type' => Auth::TOKEN_TYPE_RECOVERY,
'secret' => Auth::hash($secret), // One way hash encryption to protect DB leak
'expire' => $expires,
'expire' => $expire,
'userAgent' => $request->getUserAgent('UNKNOWN'),
'ip' => $request->getIP(),
]);
@ -1512,7 +1512,7 @@ App::post('/v1/account/recovery')
}
$url = Template::parseURL($url);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret, 'expires' => $expires]);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $profile->getId(), 'secret' => $secret, 'expire' => $expire]);
$url = Template::unParseURL($url);
$body = new Template(__DIR__.'/../../config/locale/templates/email-base.tpl');
@ -1686,7 +1686,7 @@ App::post('/v1/account/verification')
$verificationSecret = Auth::tokenGenerator();
$expires = \time() + Auth::TOKEN_EXPIRATION_CONFIRM;
$expire = \time() + Auth::TOKEN_EXPIRATION_CONFIRM;
$verification = new Document([
'$collection' => Database::SYSTEM_COLLECTION_TOKENS,
@ -1694,7 +1694,7 @@ App::post('/v1/account/verification')
'userId' => $user->getId(),
'type' => Auth::TOKEN_TYPE_VERIFICATION,
'secret' => Auth::hash($verificationSecret), // One way hash encryption to protect DB leak
'expire' => $expires,
'expire' => $expire,
'userAgent' => $request->getUserAgent('UNKNOWN'),
'ip' => $request->getIP(),
]);
@ -1716,7 +1716,7 @@ App::post('/v1/account/verification')
}
$url = Template::parseURL($url);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret, 'expires' => $expires]);
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $verificationSecret, 'expire' => $expire]);
$url = Template::unParseURL($url);
$body = new Template(__DIR__.'/../../config/locale/templates/email-base.tpl');