When an unregistered user clicks on a course link from any external source, the user is taken to the login page.
After creation of profile using Google or Facebook login, the user is correctly taken to the original URL. i.e. 'wantsurl'.
However, if any additional custom profile fields have to be filled in by the user, the user is taken to the user profile edit page. After the user submits the additional fields, the info is updated and the screen returns to the user preferences page.
In the above scenario, the user will have to go to the dashboard or search through the menus again to go to the original course (the original link).
Instead, the user should be automatically directed to the original link/url - 'wantsurl'.
Credit for the work around goes to @Yew Zhi Yong