nuxt-auth icon indicating copy to clipboard operation
nuxt-auth copied to clipboard

Invalid type of `SignInResult` when using `redirect: false`

Open mubaidr opened this issue 11 months ago • 6 comments

Environment

Nuxt project info:

------------------------------
- Operating System: Windows_NT
- Node Version:     v20.4.0
- Nuxt Version:     3.6.5
- Nitro Version:    2.5.2
- Package Manager:  [email protected]
- Builder:          vite
- User Config:      runtimeConfig, ssr, app, telemetry, imports, modules, vite, build, postcss, typescript, vue, experimental, nitro
- Runtime Modules:  [email protected], @sidebase/[email protected], @sidebase/[email protected], @pinia/[email protected], @vueuse/[email protected], [email protected], @nuxt/[email protected]
- Build Modules:    -
------------------------------

Reproduction

  • install module
  • try signin using redirect: false
  • result of signin is untyped.

Describe the bug

Typescript does not recognize type of SignInResult type, therefore unabel to extract error or url from result without specifying // @ts-ignore

Additional context

const { error, url } = await useAuth().signIn('credentials', {
      username: username.value,
      password: password.value,
      redirect: false,
    })

Logs

No response

P.S. Great job on this module! This was the missing puzzle piece for Nuxt 3. 🥳

mubaidr avatar Jul 24 '23 05:07 mubaidr