<?php
/** @var \Magento\Framework\View\Element\Template $block */
$customerSession = $block->getLayout()->getBlock('customer.session') ?? \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Customer\Model\Session::class);
$isLoggedIn = $customerSession->isLoggedIn();
$checkoutUrl = $isLoggedIn ? $block->getUrl('checkout') : $block->getUrl('authredirect');
?>

<button class="action primary checkout" onclick="window.location.href='<?php echo $checkoutUrl ?>'">
    <span>Proceed to Checkout</span>
</button>
