def METHOD_NAME(user=None):
    user = user or session.user
    if user is None:
        user_vars = {}
    else:
        user_vars = {
            'id': user.id,
            'title': user._title.name,
            'firstName': user.first_name,
            'lastName': user.last_name,
            'fullName': user.full_name,
            'email': user.email,
            'favoriteUsers': {u.id: serialize_user(u) for u in user.favorite_users},
            'language': session.lang,
            'avatarURL': user.avatar_url,
            'isAdmin': user.is_admin,
            'affiliation': user.affiliation,
            'affiliationId': user.affiliation_id,
            'affiliationMeta': AffiliationSchema().dump(user.affiliation_link) if user.affiliation_link else None,
            'address': user.address,
            'phone': user.phone,
            'type': user.principal_type.name,  # always 'user'
        }
    return render_template('assets/vars_user.js', user_vars=user_vars, user=user)