fix(admin): isolate login on admin host
Allow runtime request headers through API preflight and keep the storefront shell hidden while admin QR authentication gates backoffice.
This commit is contained in:
@@ -59,7 +59,7 @@ server {
|
|||||||
add_header Access-Control-Allow-Origin \$cors_origin always;
|
add_header Access-Control-Allow-Origin \$cors_origin always;
|
||||||
add_header Access-Control-Allow-Credentials "true" always;
|
add_header Access-Control-Allow-Credentials "true" always;
|
||||||
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" always;
|
add_header Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" always;
|
||||||
add_header Access-Control-Allow-Headers "Authorization, Content-Type, AdminWebSessionID, X-Requested-With" always;
|
add_header Access-Control-Allow-Headers "Authorization, Content-Type, AdminWebSessionID, WebSessionID, Currency, X-Language, X-Region, X-Requested-With" always;
|
||||||
add_header Vary "Origin" always;
|
add_header Vary "Origin" always;
|
||||||
|
|
||||||
if (\$request_method = OPTIONS) { return 204; }
|
if (\$request_method = OPTIONS) { return 204; }
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
<p>{{ 'app.serverError' | translate }}</p>
|
<p>{{ 'app.serverError' | translate }}</p>
|
||||||
<button class="retry-btn" (click)="retryConnection()">{{ 'app.retryConnection' | translate }}</button>
|
<button class="retry-btn" (click)="retryConnection()">{{ 'app.retryConnection' | translate }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
} @else if (isAdminHost && !isAdminRoute()) {
|
||||||
|
<app-telegram-login mode="admin" />
|
||||||
} @else if (isAdminRoute()) {
|
} @else if (isAdminRoute()) {
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
<app-telegram-login mode="admin" />
|
<app-telegram-login mode="admin" />
|
||||||
@@ -30,4 +32,4 @@
|
|||||||
}
|
}
|
||||||
<!-- <app-telegram-login /> -->
|
<!-- <app-telegram-login /> -->
|
||||||
<app-telegram-login mode="admin" />
|
<app-telegram-login mode="admin" />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ import { TelegramLoginComponent } from './components/telegram-login/telegram-log
|
|||||||
})
|
})
|
||||||
export class App implements OnInit {
|
export class App implements OnInit {
|
||||||
protected title = '';
|
protected title = '';
|
||||||
|
readonly isAdminHost = typeof window !== 'undefined'
|
||||||
|
&& window.location.hostname.toLowerCase().startsWith('admin.');
|
||||||
isHomePage = signal(true);
|
isHomePage = signal(true);
|
||||||
isAdminRoute = signal(false);
|
isAdminRoute = signal(false);
|
||||||
checkingServer = signal(true);
|
checkingServer = signal(true);
|
||||||
|
|||||||
Reference in New Issue
Block a user