Front displaying Twill's error pages
Description
It seems that the 404 pages on the routes that are not inside Twill went from this on 3.3.1:
to this, on Twill 3.4.1
The first one is the correct behaviour since the page is not under Twill, it's on frontend.
Steps to reproduce
- Open a missing URL, being on Twill 3.4.1
- You will see the Twill (yellow) one
- To fix it
- Execute
composer require area17/twill:"3.3.1", to move to Twill 3.3.1 - Refresh the page, and you will see the Laravel one
Something isn't clear for me in your report @antonioribeiro.
The yellow error pages are from Twill and that's what we want when there is an error inside Twill, not the frontend. Did you get it on the frontend? That was my concern when reviewing that PR but I thought it was covered.
Sorry @ifox , what I wrote was really unclear :(, as I just re-read it.
I just edited the description, tell me if it's better now.
I did review this and actually made a fix for it here https://github.com/area17/twill/commit/042c87e190760e140a746d0ee005c99408078c3c. Could you check what I may have overlooked?
@ifox , the problem happens here:
$matchesDomain = config('twill.support_subdomain_admin_routing') ?
Str::startsWith($requestHost, config('twill.admin_app_subdomain', 'admin') . '.') && Str::endsWith($requestHost, '.' . $adminAppUrl)
: !config('twill.admin_app_strict') || $requestHost === $adminAppUrl;
As my admin_app_strict is false, which is the default, my front domain (area17.test) is matching Twill's (admin.area17.test), because the only condition needed for it to "match" (it's an OR) is !config('twill.admin_app_strict').
So, it works fine if I set
ADMIN_APP_STRICT=true
Maybe this config should be true by default?
Here's the only URLs config I'm using for this site:
APP_DOMAIN=area17.test
APP_URL=https://${APP_DOMAIN}
ADMIN_APP_URL=https://admin.${APP_DOMAIN}
#ADMIN_APP_STRICT=true