Statamic Route Issue

Yesterday I added bugsnag logging to our statamic site. Forced an exception and bug was sent. I went to bed happy.

I woke up to find an email from bugsnag reporting a spike. 75000 exceptions roughly and climbing. Needless to say, I removed my api key for the time being.

So my issue has something to do with 3rd party apps polling our exchange autodiscover url. It checks for a subdomain but will also check the root domain at https://domain.test/autodiscover/autodiscover.xml. Since this does not exist, I just added a route redirect from that url to https://autodiscover.domain.test/autodiscover/autodiscover.xml. Great that works in the browser, but I am still getting exceptions in bugsnag.

Illuminate\Session\TokenMismatchExceptionPOST /cp/auth/login

{
  "Content-Type": "text/xml; charset=utf-8",
  "Content-Length": "1005",
  "X-Arr-Log-Id": "guid here",
  "X-Arr-Ssl": "cert stuff here",
  "X-Original-Url": "/cp/auth/login?expired=1",
  "User-Agent": "ESMAgent/3.0.2.245 (+http://www.symprex.com/esm)",
  "Max-Forwards": "10",
  "Host": "domain.test",
  "Expect": "100-continue",
  "Connection": "Keep-Alive"
}

I have seen Outlook as the user-agent too. So here is my actual question. Why are these requests automatically getting routed to the cp login? I even changed my cp name to some else like mycp and the exceptions still kept occurring by now with /mycp/auth/login?expired=1 as the route.

Illuminate\Session\TokenMismatchException
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php:53 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php:49 Illuminate\View\Middleware\ShareErrorsFromSession::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:62 Illuminate\Session\Middleware\StartSession::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php:37 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php:59 Illuminate\Cookie\Middleware\EncryptCookies::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\core\StaticCaching\Middleware\Retrieve.php:33 Statamic\StaticCaching\Middleware\Retrieve::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php:44 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::handle
    [internal] call_user_func_array
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:124 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}
    [internal] call_user_func
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:102 Illuminate\Pipeline\Pipeline::then
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:122 Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter
    C:\inetpub\wwwroot\2\statamic\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:87 Illuminate\Foundation\Http\Kernel::handle
    C:\inetpub\wwwroot\2\index.php:167 [main]

I that wasn't too much information. ;) Running IIS and php 7.3.3

>>>>>>> Unanswered <<<<<<<
1 Reply
1 Follower