I am extending an application built in this YT-Tutorial (https://www.youtube.com/watch?v=ucX2zXAZ1I0) using NextJS 13.5.4, (AppRouter) TypeScript, trpc for requests and Kinde for Auth management.
My problem is as follows: When logged in, i wanted to give a User the possibility to delete all his files and finally his account (in my Prisma DB and at Kinde).
I managed to do this, at the and of this request however, I would like to automatically log the user out and end his active Kinde session (such that using the "Back"-Click in the browser does not bring me back in my application (as it crashes the application)) and redirect the User to the front page of the app.
I have searched through this discord and the threads around this topic did not resolve my problem so far (or I didn't succeed).