Updated password-based login to return to previous page