port-nimara-client-portal/plugins/00.startup-check.client.ts

26 lines
903 B
TypeScript

export default defineNuxtPlugin(async () => {
// Client-side startup checks
console.log('[STARTUP] Client-side initialization starting...')
try {
// Check if OIDC is available
if (process.client) {
console.log('[STARTUP] Client environment detected')
console.log('[STARTUP] Current URL:', window.location.href)
// Check for OAuth callback
if (window.location.pathname.includes('/auth/keycloak/callback')) {
console.log('[STARTUP] OAuth callback detected - URL:', window.location.href)
}
// Check localStorage for any existing sessions
const hasStorage = typeof Storage !== 'undefined'
console.log('[STARTUP] Storage available:', hasStorage)
}
console.log('[STARTUP] Client-side initialization complete')
} catch (error) {
console.error('[STARTUP] Client-side initialization error:', error)
}
})