Added a redirection to referrer page

Checkout this code to see if it is a good implementation of redirecting to the last attempted URL on successful sign-in.