From 646543cfee7efd367ec3876bb62cf3c3de1ef5af Mon Sep 17 00:00:00 2001 From: Adrian Hopek Date: Tue, 15 Mar 2022 15:01:28 +0100 Subject: [PATCH] #75 - fix data leak to ui-avatars --- app/Eloquent/Models/User.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Eloquent/Models/User.php b/app/Eloquent/Models/User.php index baf733b..f0686d2 100644 --- a/app/Eloquent/Models/User.php +++ b/app/Eloquent/Models/User.php @@ -13,6 +13,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; use Illuminate\Support\Carbon; use Illuminate\Support\Collection; +use Illuminate\Support\Str; use Rackbeat\UIAvatars\HasAvatar; use Toby\Domain\Enums\EmploymentForm; use Toby\Domain\Enums\Role; @@ -101,9 +102,9 @@ class User extends Authenticatable return $this->role === $role; } - protected function getAvatarNameKey(): string + protected function getAvatarName(): string { - return "fullName"; + return mb_substr($this->first_name, 0, 1) . mb_substr($this->last_name, 0, 1); } protected static function newFactory(): UserFactory