Hi team, I am using your managed service option. While setting up log messages, I am interested in showing name(part of user metadata) in it. Right now I am fetching user Id from session and calling your db to get corresponding name. Since I am making db calls for every log message, I was wondering if there is a better alternative to do this. Please suggest if any.
r
rp_st
05/24/2023, 6:25 AM
hey @yvstrishul you could store that info in the session's access token payload and then read from that. It won't require any db calls.
You could also consider implementing your own in memory caching by overriding the user metadata recipe functions.
y
yvstrishul
05/24/2023, 6:27 AM
You store logs of our activity, right? Is there a similar situation there? maybe to show email instead user Id, if yes- could you tell me how do you handle it there?
r
rp_st
05/24/2023, 6:29 AM
we store based on user ID. Since the userID can be used to fetch anything about the user.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).