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.
(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.
(According to this ^)
REQUEST
Please add a type to the useKindeClient function. :sweat_smile:
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. (Nuxt Auto imports useKindeClient)Additionally, assigning useKindeClient to a variable named
client
and using it to access theisloggedin
method returns anany
type.SOLUTION After researching with the assistance of @DanielRivers from the Kinde Discord Server, I concluded that importing
useAuth
instead ofuseKindeClient
is the correct approach. This has the appropriate type and enables you to utilize theloggedIn
method to verify whether the user is logged in.(According to this ^)
REQUEST Please add a type to the
useKindeClient
function. :sweat_smile: