No, $user is the user object, you can get it by: (assume v2025)
$user = LoadUserByIdentifier($username);
Don’t try to include common script yourself. If you do it wrongly (as in your other post), you cannot use the global functions. If your custom file has HTML content to show after logging in the user, you only need to enable Include common files.
If you only login the user and do something without any HTML in response, you better use Route_Action server event.