In the SSD assignment we need to create audit logs right. There we need to add the userId in each document. We will get the userInfo from the session. But if we want to add the userId in the audit process we need to use the session node on each logs and pass the user id to the auditCreateService. Is there is any other method to do this without calling the session in every api flow ?. Need some suggestions about this.
Hi @Aswin,
Yes the is a way you can create a flow that get userInfo from session then add it on middleware .
Then just use that middleware on each and every api or make it global on middlewares.
Have added a middleware documentation link below.
3 Likes