puppy333
puppy333
KKinde
Created by 9M6 on 5/11/2024 in #💻┃support
Nuxt useKindeClient not working properly
Also, here's an example of using the useKindeClient composable in a .vue file: https://github.com/nuxt-modules/kinde/blob/main/playground%2Fpages%2Fdashboard.vue
4 replies
KKinde
Created by 9M6 on 5/11/2024 in #💻┃support
Nuxt useKindeClient not working properly
In server routes you can access the kinde client like this:
export default defineEventHandler(async (event) => {
const kindeClient = event.context.kinde;

// Or call a function directly
const kindeAccessToken = await event.context.kinde.getToken();
}
export default defineEventHandler(async (event) => {
const kindeClient = event.context.kinde;

// Or call a function directly
const kindeAccessToken = await event.context.kinde.getToken();
}
The useKindeClient() composable is server only according to this note on the module page, which means it will only run on the server when the components are being pre-rendered and not again in the browser: https://nuxt.com/modules/kinde#usekindeclient
4 replies
KKinde
Created by jixxywizzy on 4/18/2024 in #💻┃support
Logout the same user if logged in on another device
the same logic would apply then, you just change the trigger which logs out other sessions to whenever the user logs in
7 replies
KKinde
Created by jixxywizzy on 4/18/2024 in #💻┃support
Logout the same user if logged in on another device
being the most recent one
7 replies
KKinde
Created by jixxywizzy on 4/18/2024 in #💻┃support
Logout the same user if logged in on another device
so you want a user to only be able to be logged in on one device at a time?
7 replies
KKinde
Created by jixxywizzy on 4/18/2024 in #💻┃support
Logout the same user if logged in on another device
So, the way to enable this on the client-side is to have a listener of some sort listen for "logged out" events. Something like supabase realtime tables or redis could help with this. The "logout event" would be triggered anywhere that you have the logout action available to the user. So you press logout button on a client, the logout event is performed in the local client, then update is sent to the real time system. Then the listeners in the other clients receive that event and programmatically log out the user in each client instance.
7 replies
KKinde
Created by Aung.S on 3/27/2024 in #💻┃support
Delete user function?
With the management api you can update a user's suspended status: https://kinde.com/api/docs/#update-user And you can also delete a user with the same api: https://kinde.com/api/docs/#delete-user
3 replies