Log file security.

This commit is contained in:
James Cole 2018-03-30 14:50:44 +02:00
parent 62b3986fcd
commit 15f8cd49d3
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -49,8 +49,8 @@ trait VerifiesAccessToken
*/
protected function verifyAccessToken(): bool
{
$userId = intval($this->option('user'));
$token = strval($this->option('token'));
$userId = (int)$this->option('user');
$token = (int)$this->option('token');
/** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class);
$user = $repository->find($userId);
@ -68,7 +68,7 @@ trait VerifiesAccessToken
}
if (!($accessToken->data === $token)) {
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;
}