title: Problems with routing the default identity pages in an ASP.NET Core with Razor app
body: <p>I'm having trouble with login in ASP.NET Core 3.0 app.</p>
  
  <p>Essentially, I want the login page to be at </p>
  
  <pre><code>mywebsite.com/login
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>mywebsite.com/SomerandomRoute/SomeMore/WhyNot/MakeTheUrl/EvenLonger/Identity/Cookies/DefaultIdentity/Pages/Sections/Defaults/Identity/LoginRouteController
  </code></pre>
  
  <p>as is the default. So I added <code>@page "/login"</code> to the identity login <code>.cshtml</code> file, and it works when clicking "log in" in the top nav.</p>
  
  <p>Thing is, with that alone, redirecting from protected pages doesn't work. As in, if I'm not logged in and go to the account settings URL, I get redirected to the long abomination of an URL instead of <code>/login</code>. And that route doesn't exist now.</p>
  
  <p>In my 2.2 app I could just</p>
  
  <pre class="lang-cs prettyprint-override"><code>services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
      .AddCookie(options =&gt;
      {
          options.LoginPath = "/login";
      });
  </code></pre>
  
  <p>and it would work, but in this 3.0 app it breaks login completely. Submitting the login form just redirects to index and the user isn't logged in.</p>
  
  <p>I tried looking for breaking changes between 2.2 and 3.0, but nothing seems to say anything about my particular issue.</p>