3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-04 10:05:35 +00:00

Fixed #18135 - only unset variables if the user is authenticated (Web UI)

This commit is contained in:
snipe
2026-01-14 13:10:46 +00:00
parent 68b590c263
commit 039b4cf19f

View File

@ -10,6 +10,7 @@ use App\Notifications\WelcomeNotification;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Auth;
/**
* This is ONLY used for the User Import. When we are importing users
@ -102,8 +103,7 @@ class UserImporter extends ItemImporter
$this->log('Updating User');
// Todo - check that this works
if (!Gate::allows('canEditAuthFields', $user)) {
if (Auth::check() && (!Gate::allows('canEditAuthFields', $user))) {
unset($user->username);
unset($user->email);
unset($user->password);