Getting info on the currently logged in user
Craft::$app-&gt;getUser()


returns only the user service/component. You should read the docs about that

What you want is the current Identity

Craft::$app-&gt;getUser()-&gt;getIdentity()