'redirect to most recent url after successful social login for django-allauth

On my website, login button is accessible on many different pages.

How can redirect users who clicked Login button to social login successfully to most recent page where they clicked the Login button after their successful login ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source