import { createHash } from 'node:crypto' /** * Short, non-reversible key of the current login session. * * `logship_session` is httpOnly and regenerated on every login, so the client * cannot read it — this exposes a hash of it so the UI can do something exactly * once per login (the dashboard's terminal greeting plays its type-in animation * only when the key differs from the one it stored in localStorage). * * No iDempiere call, hence no token-refresh wrapper. No session → empty key. */ export default defineEventHandler((event) => { const session = String(getCookie(event, 'logship_session') || '') return { sessionKey: session ? createHash('sha256').update(session).digest('hex').slice(0, 16) : '' } })