fix(ui): add Cache-Control no-cache middleware and version tags to auth-client.js to prevent stale browser caching
This commit is contained in:
parent
b867a166e9
commit
ce29459f78
@ -159,7 +159,7 @@ export const AuthenticatedLayout = ({
|
|||||||
</style>
|
</style>
|
||||||
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.umd.min.js">
|
<script src="https://unpkg.com/@simplewebauthn/browser/dist/bundle/index.umd.min.js">
|
||||||
</script>
|
</script>
|
||||||
<script src="/public/auth-client.js"></script>
|
<script src="/public/auth-client.js?v=2"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="header">
|
<header class="header">
|
||||||
|
|||||||
@ -95,7 +95,7 @@ export const LoginPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/public/auth-client.js"></script>
|
<script src="/public/auth-client.js?v=2"></script>
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
|
|||||||
@ -119,7 +119,7 @@ export const RegisterPage = (
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/public/auth-client.js"></script>
|
<script src="/public/auth-client.js?v=2"></script>
|
||||||
<script
|
<script
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={{
|
||||||
__html: `
|
__html: `
|
||||||
|
|||||||
@ -324,7 +324,12 @@ uiApp.get("/admin/audit-logs", async (c) => {
|
|||||||
return c.html(AuditLogPage({ logs }));
|
return c.html(AuditLogPage({ logs }));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Explicit Side Effect: Serving static assets (client-side JS)
|
// Explicit Side Effect: Serving static assets (client-side JS) with no-cache headers to prevent stale browser caches
|
||||||
|
uiApp.use("/public/*", async (c, next) => {
|
||||||
|
await next();
|
||||||
|
c.header("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
|
});
|
||||||
|
|
||||||
uiApp.get(
|
uiApp.get(
|
||||||
"/public/*",
|
"/public/*",
|
||||||
serveStatic({
|
serveStatic({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user