You can force the user to log in before going to checkout.
To enable it, go to Catalog Settings > Quote Cart and set the ‘Remember fields by’ option to ‘User Account’ and save the settings.
Now find the Login Before Checkout checkbox to enable this option.
Once you enable this option, it will prompt the user to log in before checkout.