reports/frontend/vite.config.ts
jtricerolph 21224c0ebe Fix session-expiry redirect breaking standalone PWA out of its shell
Same fix as maintenance/room-planner: manifest scope was the app's
own base path instead of "/", and AuthGate unconditionally hard-
navigated window.top to the central /login on session expiry even
when not embedded in the portal iframe — together these dropped an
installed/standalone reports PWA into the portal's framed browser
view instead of staying in its own window.

AuthGate now only bounces to central login when actually embedded
(passing ?from= so it returns here afterwards); standalone or
directly-opened tabs get an in-app login form and never navigate
away. Also wired up the previously-dead inactivity auto-logout timer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 17:07:00 +00:00

31 lines
878 B
TypeScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
base: '/reports/',
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
manifest: {
name: 'Reports',
short_name: 'Reports',
start_url: '/reports/',
scope: '/',
display: 'standalone',
theme_color: '#1d4ed8',
background_color: '#1d4ed8',
icons: [
{ src: '/reports/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/reports/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
],
},
workbox: {
navigateFallback: '/reports/index.html',
navigateFallbackDenylist: [/\/api\//],
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
},
}),
],
})