Fix api auth for tmp links (issue #1819)