I'm having problems fetching the member active role when cookieCache is enabled.
For context, I'm implementing an invitation feature for my SaaS. Basically, I send an email with an invitation link. The recipient clicks the link, gets redirected to a sign-up form, creates a new account, automatically accepts the invitation, and is finally redirected to the dashboard.
However, right after the invitation is accepted, calls to getActiveMemberRole still return null or an outdated role. This seems to happen because getActiveMemberRole relies on the cookieCache, which is not revalidated after the invitation acceptance.
Even when the session is valid and the membership has been created correctly in the database, the active member role is not updated until the cookie expires or the user signs out and signs in again. I also noticed that disableCookieCache works as expected with getSession, but there is no way to use it with getActiveMemberRole.
Is there a recommended way to force the cookie cache to be refreshed after accepting an invitation?