Is there a way to logout in nextjs without using Link Logout?
I want to logout but link component does not satisfy our team needs as we are looking for a way to logout using button click event handlers. How can we do this? is it possible? i was reviewing the repo and cant find any, if not, is this planned? i think a few hooks may be very handy for us devs with some basic functionalities like login, logout, signup
14 Replies
Hey @DavidF9265,
Thanks for reaching out and thanks for helping out on other support queries.
What SDK are you using?
im using nextjs sdk
I was asking kindeAI and it suggested using logout() from useKindeAuth, but this seems to be an incorrect assumption from the AI as i can't find that method
Gotcha. And sorry that the AI responded incrrectly. I will look into that AI response with my team. We are always looking to optimise the responses from the AI bot
Dont worry about the AI... there's always AI hallucination issues
however
Then are there any other approaches for all of those user session actions?
Then are there any other approaches for all of those user session actions?Are you able to elaborate on what you are referring to here? Also... I am looking into your query. Apologise, I forgot to mention this
Sure, don't worry about it
let me elaborate then
I want to logout but link component does not satisfy our team needs as we are looking for a way to logout using button click event handlers. How can we do this? is it possible?Are you able to elaborate on why the link components don't satisfy your team needs? And why you want to implement " logout using button click event handlers"? Do you want to do something like this
Yeah, we are looking on something like that
We would like to implement something like that because Link is not satisfying the correct UX when using dropdown items. User clicks on the item, but action is not triggered unless the user clicks directly over the label
(I want to point out that i just found a temporary workaround placing the link in the dom and clicking it from a handler, however i feel this may not be a "good practice")
Dont you think some hooks may be handy here for a cleaner development experience?
idk
Ok i think i missed this part of the sdk docs:
then, i understand logout works the same way
we will work it out this way and come back if we have any issues
thanks a lot @Oli - Kinde
Good to hear you were able to figure it out.
Please don't hesitate to reach out if you come across any other issues.
By the way, we will be rolling out a new AI support bot tomorrow as our existing provider is stopping their service.
Please feel free to reach out to me directly if you come across any responses that seem off once we implement the new AI support bot tomorrow - you can tag me in the thread.
Also, cannot thankt you enough for jumping in on other threads from community members.
Its people like you that make this community so great!
haha Kinde has been great for us, we love your product and support