Current author archive in navigation menu

Finally I figured it out and I am posting the solution for anyone who may be interested in such a workaround:

function my_nav_menu_author_link( $menu )
{
    if( !is_user_logged_in() ){

        return $menu;

    } else {

        $link = get_author_posts_url( get_current_user_id() );

        $class = is_author() ? ' class="current-menu-item"' : '';

        $author_archive_link = 
        '<li' . $class . '>' .
             '<a href="' . $link . '" >' .
                 __( 'My posts' ) .
             '</a>' .
         '</li>';

        $menu = $menu . $author_archive_link;

        return $menu;

    }
}

add_filter( 'wp_nav_menu_items', 'my_nav_menu_author_link' );