fully typing for hanko events added via component prop
@danielroe It seems like I don't quite understand something regarding the type definitions in the published version of the module.
When I run pnpm dev:prepare from the root of the repository, I get the correct types for event.context.hanko in API-routes in the playground demo.
However if I use the module the "normal" way, by running pnpm i and pnpm dev directly in the playground directory, I don't get the type information (then it's typed as any like before).
Do you have any insights into what's happening / how this can be fixed?
~~Ah, we probably need to add the underlying package providing the types with typescript.hoist.~~
Tested this, seems to be working fine in a fresh project.
Any chance you could provide a reproduction @felix-dolderer?
@danielroe Sorry, my message was not very specific. Using await verifyHankoEvent(event) works fine, but when accessing the event.context.hanko property directly, it is typed as any.
While writing this I noticed that I probably misunderstood something on my side. Before verifying the event we can't know if the property exists. The only sensible type-information we could provide there would be HankoPayload | undefined
No, you're right. The issue is that we're augmenting the type in the 'vue' side of the app rather than in the 'nitro' side. We don't currently have a way to do that easily so that's probably a feature we need in Nuxt.