Valardir
KKinde
•Created by Valardir on 9/5/2024 in #💻┃support
getKindeServerSession() - secure?
Hi, I am currently building a webapp with NextJS and Kinde. If I use const {getUser} = getKindeServerSession(); in the server components, will fresh data be fetched directly from the Kinde database or does this method only read the cookie value of the currently logged in user?
Use case: If users want to make changes to their profile data, only they should be able to do so. To check this condition, I first want to check if the user is authenticated, otherwise he will be redirected, and if he is, he can make changes to his profile data (server actions). The value is written to the secondary user database if the current user.id == userId in the database. Is there a better way to do this with one of the kinde tools?
2 replies