The Magento backend options allow to redirect customers to the previous page after login in Magento and Magento 2. The default setting is to redirect the customer to “My Account” section after login
Visit https://meetanshi.co...gin-in-magento/ to read the method for the same and improve the user experience of your Magento stores!