Redirect the instance app login to the hosting app

Save the referrer so the user is redirected back to the page they
clicked the login link on.