KindeK
Kinde2y ago
3 replies
Sadi

Nuxt useKindeClient not working properly

Hello,

I'm trying to use Kinde with Nuxt, the module is quite barebones and doesnt seem to support all things, a few things I want to do:

1. Custom Sign In / Sign Up
2. useKindeClient does not work both on server/api/auth/login.ts as an api route, neither in any of the components

on part of the tutorials I see:

const client = useKindeClient();

const {data: permissions} = await useAsyncData(async () => {
  const {permissions} = (await client?.getPermissions()) ?? {};
  return permissions;
});
// { orgCode: 'org_1234', permissions: ['create:todos', 'update:todos', 'read:todos'] }

const {data: hasAccess} = await useAsyncData(async () => {
  return (await client?.getPermission("create:todos")) ?? {};
});
// { orgCode: 'org_1234', isGranted: true }


but this code does not specify where this should run, backend or frontend, frontend wise does not run; and I cant try on the backend since it does not import useKindeClient (auto-imports

any help appreciated.
Was this page helpful?