Skip to content
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

[qwik] Re-export main types from core #11897

Closed
ianlet opened this issue Sep 23, 2024 · 0 comments · Fixed by #11898
Closed

[qwik] Re-export main types from core #11897

ianlet opened this issue Sep 23, 2024 · 0 comments · Fixed by #11898
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@ianlet
Copy link
Contributor

ianlet commented Sep 23, 2024

Environment


  System:
    OS: Linux 6.10 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
    Memory: 2.15 GB / 15.37 GB
    Container: Yes
    Shell: 3.7.1 - /usr/bin/fish
  Binaries:
    Node: 21.6.2 - ~/.asdf/installs/nodejs/21.6.2/bin/node
    Yarn: 1.22.19 - ~/.asdf/shims/yarn
    npm: 10.2.4 - ~/.asdf/plugins/nodejs/shims/npm
    pnpm: 9.2.0 - ~/.asdf/installs/pnpm/9.2.0/bin/pnpm
  Browsers:
    Chromium: 129.0.6668.58
  npmPackages:
    @auth/core: ^0.34.2 => 0.34.2
    @auth/qwik: 0.2.2 => 0.2.2

Reproduction URL

https://github.com/ianlet/qwik-authjs-types

Describe the issue

The framework integration for Qwik doesn't re-export core types such as Session, User, their adapters, etc. which causes these 2 issues:

How to reproduce

In the reproduction repo, we can see here that even if we de-comment the section at the top and adjust to redeclare the proper module, we will still get the highlighted error.

Expected behavior

Using, for example, this:

declare module "@auth/qwik" {
  /**
   * The shape of the user object returned in the OAuth providers' `profile` callback,
   * or the second parameter of the `session` callback, when using a database.
   */
  interface User {}
  /**
   * The shape of the account object returned in the OAuth providers' `account` callback,
   * Usually contains information about the provider being used, like OAuth tokens (`access_token`, etc).
   */
  interface Account {}
 
  /**
   * Returned by `useSession`, `auth`, contains information about the active session.
   */
  interface Session {}
}
 
import { JWT } from "@auth/qwik/jwt"
 
declare module "@auth/qwik/jwt" {
  /** Returned by the `jwt` callback and `auth`, when using JWT sessions */
  interface JWT {
    /** OpenID ID Token */
    idToken?: string
  }
}

we should be able to extend the Session and other core types (User, Account, etc.) when using the @auth/qwik framework.

The documentation on module augmentation for qwik should reflect that as well.

@ianlet ianlet added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant