Something went wrong. Try again.
[READ-ONLY]
a fast, modern browser for the npm registry forked from npmx.dev/npmx.dev
Something went wrong. Try again.
1234567891011121314151617181920212223// This is for getting the session on the npmx server and differs from the OAuthSessionimport type { H3Event } from 'h3'import type { UserServerSession } from '#shared/types/userSession'
/** * Get's the user's session that is stored on the server * @param event * @returns */export const useServerSession = async (event: H3Event) => { const config = useRuntimeConfig(event)
if (!config.sessionPassword) { throw new Error('Session password is not configured') }
const serverSession = useSession<UserServerSession>(event, { password: config.sessionPassword, })
return serverSession}