nuxt-modules / kinde

Kinde integration for Nuxt
69 stars 7 forks source link

useKindeClient incorrect type #74

Closed devniza closed 1 month ago

devniza commented 6 months ago

I've been attempting to access the user login state in the script tag, rather than relying on $auth which is only available in the template tag.

ISSUE When importing useKindeClient and attempting to use it in the script tag, it produces a warning that it is an any tag. image (Nuxt Auto imports useKindeClient)

Additionally, assigning useKindeClient to a variable named client and using it to access the isloggedin method returns an any type.

SOLUTION After researching with the assistance of @DanielRivers from the Kinde Discord Server, I concluded that importing useAuth instead of useKindeClient is the correct approach. This has the appropriate type and enables you to utilize the loggedIn method to verify whether the user is logged in.

image image (According to this ^)

REQUEST Please add a type to the useKindeClient function. :sweat_smile: