mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 00:04:24 +00:00
Log file security.
This commit is contained in:
@@ -49,8 +49,8 @@ trait VerifiesAccessToken
|
|||||||
*/
|
*/
|
||||||
protected function verifyAccessToken(): bool
|
protected function verifyAccessToken(): bool
|
||||||
{
|
{
|
||||||
$userId = intval($this->option('user'));
|
$userId = (int)$this->option('user');
|
||||||
$token = strval($this->option('token'));
|
$token = (int)$this->option('token');
|
||||||
/** @var UserRepositoryInterface $repository */
|
/** @var UserRepositoryInterface $repository */
|
||||||
$repository = app(UserRepositoryInterface::class);
|
$repository = app(UserRepositoryInterface::class);
|
||||||
$user = $repository->find($userId);
|
$user = $repository->find($userId);
|
||||||
@@ -68,7 +68,7 @@ trait VerifiesAccessToken
|
|||||||
}
|
}
|
||||||
if (!($accessToken->data === $token)) {
|
if (!($accessToken->data === $token)) {
|
||||||
Log::error(sprintf('Invalid access token for user #%d.', $userId));
|
Log::error(sprintf('Invalid access token for user #%d.', $userId));
|
||||||
Log::error(sprintf('Token given is "%s", expected "%s".', $token, $accessToken->data));
|
Log::error(sprintf('Token given is "%s", expected something else.', $token));
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user