I am trying to use next-auth with the patreon api. Logging in & out works fine, but I now want to also save the users tier somewhere - the question is where? I was thinking of putting it directly on the jwt via the jwt callback, or maybe in the session via the session callback.
I have tried adding it to the session, but it seems to really slow down login:
async session({ session, token, user }) {
session.access_token = token.access_token;
let tier = await getUserTier({ access_token: token.access_token });
session.tier = tier;
return session;
}
It also feels inefficient fetching this data every single time the session callback is called - which seems to be a lot. Is there any way to speed up this process of checking the tier? Is there any convention over where I could save the tier?