This extension adds a "Log in as user" button on user profiles for administrators and others who are granted the permission.
Install manually:
composer require fof/impersonate:"*"
composer update fof/impersonate
php flarum migrate
php flarum cache:clear
You can configure which groups can impersonate users by going to Permissions > Login as other users. Use with caution, as anybody with that permission can easily access the private data of every user on the forum. non-admins cannot impersonate an admin account, for security reasons.