Skip to content

bug: Nuxt; Typescript types not properly resolved on server #917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sruusk opened this issue Feb 20, 2025 · 2 comments
Open

bug: Nuxt; Typescript types not properly resolved on server #917

sruusk opened this issue Feb 20, 2025 · 2 comments
Labels
bug Something isn't working pending-verification

Comments

@sruusk
Copy link

sruusk commented Feb 20, 2025

Describe the bug

Types for event.context.logtoUser are not fully available in Nuxt server; thus, type checking doesn't work properly.

Expected behavior

N/A

How to reproduce?

N/A

Context

N/A

Fix

This can be fixed by extending the H3EventContext:

declare module 'h3' {
  interface H3EventContext {
    logtoUser: UserInfoResponse | IdTokenClaims | undefined;
  }
}

Sorry if this issue is a bit lacking. :)

@sruusk sruusk added the bug Something isn't working label Feb 20, 2025
@sruusk
Copy link
Author

sruusk commented Feb 27, 2025

I just realised that event.context.logtoUser isn't really documented anywhere, even though the SDK uses an event handler to modify the event object, so that logtoUser and logtoClient are available in the server routes event context.

@wangsijie wangsijie self-assigned this Feb 28, 2025
@wangsijie wangsijie removed their assignment May 10, 2025
@wangsijie
Copy link
Contributor

Hi, thanks for the suggestion, would you mind submitting a PR on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending-verification
Development

No branches or pull requests

3 participants