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

CustomUser TypeScript generic type variable not propagated throughout codebase #1225

Open
KeithGillette opened this issue Jun 16, 2022 · 1 comment
Labels

Comments

@KeithGillette
Copy link

KeithGillette commented Jun 16, 2022

Bug report

Describe the bug

AccountsServer and AccountsPassword are generic classes allowing a CustomUser type variable to be passed, presumably to allow for typing extensions to the AccountsJS User type. However, User instead of CustomUser is referenced in many other locations in the code (for example, EmailTemplateType and all Mongo methods), leading to errors when attempting to access custom properties on extended User implementations.

Expected behavior

A type variable passed to AccountsServer and AccountsPassword would be respected on their implementation methods.

System information

    "@accounts/apollo-link": "0.32.1",
    "@accounts/client": "0.33.1",
    "@accounts/graphql-api": "0.33.2",
    "@accounts/graphql-client": "0.33.1",
    "@accounts/magic-link": "0.1.1",
    "@accounts/mongo": "0.34.0",
    "@accounts/mongo-password": "0.32.4",
    "@accounts/password": "0.32.1",
    "@accounts/server": "0.33.1",

Additional context

I suppose this could be considered a feature request but it just looks like generics are only partially implemented, so I'm submitting it as a bug.

@danyhiol
Copy link

Same here. If we can extend interfaces (User), then we should also be able to pass generics to all those classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants