Skip to content

Commit c62b22f

Browse files
committed
Support subdomain
1 parent 247d081 commit c62b22f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

UPGRADE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ If you are relying on Quill.js specifics (like css classes), use `'type' => 'qui
5252
Previously `withVideo` was true by default, if you relied on this you have to update these media fields to
5353
`'withVideo' => true`.
5454

55-
#### SVG's are now no longer passing thorough glide
55+
#### SVG's are now no longer passing through glide
5656

5757
These are now rendered directly, you can change this by updating config `twill.glide.original_media_for_extensions` to an empty array `[]`
5858

src/TwillRoutes.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,13 @@ public function getAuthRedirectPath(): string
405405

406406
public function isTwillRequest(): bool
407407
{
408-
$adminAppUrl = config('twill.admin_app_url', config('app.url'));
408+
$adminAppUrl = str_replace(['http://', 'https://'], '', config('twill.admin_app_url', config('app.url')));
409+
$requestHost = \request()->getHttpHost();
410+
411+
$matchesDomain = config('twill.support_subdomain_admin_routing') ?
412+
Str::startsWith($requestHost, config('twill.admin_app_subdomain', 'admin')) && Str::endsWith($requestHost, $adminAppUrl)
413+
: !config('twill.admin_app_strict') || $requestHost === $adminAppUrl;
409414

410-
$matchesDomain = !config('twill.admin_app_strict') || Str::endsWith(\request()->getSchemeAndHttpHost(), $adminAppUrl);
411415
$matchesPath = empty(config('twill.admin_app_path')) || \request()->is(config('twill.admin_app_path', '') . '*');
412416

413417
return $matchesDomain && $matchesPath;

0 commit comments

Comments
 (0)