Investigate whether this a secure approach.
i.e. is there a better way of doing this than getting the userId on the client side and passing it into the function
const handleStartSession = async () => {
if (!userId) {
return;
}
// create a new conversation
console.log("Creating new conversation for user: ", userId);
const conversation = await createNewConversation(userId);
setConversationId(conversation.id);
console.log("Conversation created with id: ", conversation.id);
setShowModal(false);
};
Investigate whether this a secure approach. i.e. is there a better way of doing this than getting the userId on the client side and passing it into the function