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

Documentation mentions disabling endpoints with ‍‍false, but the feature is missing in v0.10.0 and causes TypeScript errors #995

Open
ErfanBahramali opened this issue Jan 29, 2025 · 0 comments
Labels
bug A bug that needs to be resolved pending An issue waiting for triage

Comments

@ErfanBahramali
Copy link

ErfanBahramali commented Jan 29, 2025

Environment

bunx nuxi info

  • Operating System: Linux
  • Node Version: v20.9.0
  • Nuxt Version: 3.15.4
  • CLI Version: 3.21.1
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: ssr, runtimeConfig, compatibilityDate, vite, devtools, modules, auth
  • Runtime Modules: @sidebase/[email protected]
  • Build Modules: -

Reproduction

  1. Install @sidebase/[email protected] in a Nuxt project.
  2. Attempt to disable the signUp endpoint by setting it to false in the configuration:
auth: {
  provider: {
    type: 'local',
    endpoints: {
      signUp: false,
    }
  }
}

Describe the bug

The documentation for sidebase/nuxt-auth states that endpoints can be disabled by setting them to false:

"You can customize each endpoint to fit your needs or disable it by setting it to false. For example you may want to disable the signUp endpoint. "

However, this feature is not yet released and only exists in the main branch. In the current version (v0.10.0), attempting to set an endpoint to false results in a TypeScript error:

Type 'false' has no properties in common with type '{ path?: string | undefined; method?: "options" | "head" | "get" | "patch" | "post" | "put" | "delete" | "connect" | "trace" | undefined; }'.ts(2559)

Additional context

  1. In version 0.10.0, the signUp method in useAuth.ts does not check whether the endpoint is false before attempting to use it.
  2. The TypeScript definition in types.ts does not allow false for signUp

The feature to disable endpoints with false exists in the main branch but has not been included in any released version.
Updating the documentation to clarify that this feature is not available yet would prevent confusion.

main: useAuth.ts , types.ts

@ErfanBahramali ErfanBahramali added bug A bug that needs to be resolved pending An issue waiting for triage labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug that needs to be resolved pending An issue waiting for triage
Projects
None yet
Development

No branches or pull requests

1 participant