Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front displaying Twill's error pages #2692

Open
antonioribeiro opened this issue Nov 12, 2024 · 5 comments
Open

Front displaying Twill's error pages #2692

antonioribeiro opened this issue Nov 12, 2024 · 5 comments

Comments

@antonioribeiro
Copy link
Member

antonioribeiro commented Nov 12, 2024

Description

It seems that the 404 pages on the routes that are not inside Twill went from this on 3.3.1:

Screenshot 2024-11-12 at 15 43 07

to this, on Twill 3.4.1

Screenshot 2024-11-12 at 15 43 47

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
@ifox
Copy link
Member

ifox commented Nov 19, 2024

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.

@antonioribeiro
Copy link
Member Author

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.

@ifox
Copy link
Member

ifox commented Nov 19, 2024

I did review this and actually made a fix for it here 042c87e. Could you check what I may have overlooked?

@antonioribeiro
Copy link
Member Author

@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?

@antonioribeiro
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants