mirror of
https://github.com/element-hq/matrix-authentication-service.git
synced 2026-08-14 17:50:08 +00:00
Instead of injecting configuration through inline <script> tags setting window globals, server-rendered templates now carry the configuration as data attributes on the entrypoint mount node, validated client-side with a valibot schema over element.dataset. This removes all inline scripts from the templates, which is friendlier to CSP, and gives the frontend runtime-validated, typed configuration. The DOM read and the wiring now happen in the entrypoints themselves: main.tsx parses the mount node dataset, owns the QueryClient, and injects the basepath and GraphQL endpoint into the router and request layer instead of those being module-scope singletons.
25 lines
722 B
HTML
25 lines
722 B
HTML
<!--
|
|
Copyright 2025, 2026 Element Creations Ltd.
|
|
Copyright 2024, 2025 New Vector Ltd.
|
|
Copyright 2022-2024 The Matrix.org Foundation C.I.C.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
-->
|
|
|
|
<!-- Must be kept in sync with templates/app.html -->
|
|
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>matrix-authentication-service</title>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="root" data-root="/account/" data-graphql-endpoint="/graphql"></div>
|
|
<script type="module" src="/src/entrypoints/main.tsx"></script>
|
|
</body>
|
|
</html>
|