refreshCache warning for stateless with secondaryStorage
I'm receiving the following warning when using secondaryStorage.
WARN [Better Auth]: [better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` — remove it from your config to silence this warning.
WARN [Better Auth]: [better-auth] `session.cookieCache.refreshCache` is enabled while `database` or `secondaryStorage` is configured. `refreshCache` is meant for stateless (DB-less) setups. Disabling `refreshCache` — remove it from your config to silence this warning.
It's my understanding that the user auth's with the provider, which stores the key in secondaryStorage, then the client uses a refresh token to auth to secondaryStorage. (all simplified)
This way is currently working for me. I'm able to expire the session and delete the user from secondaryStorage, which then should invalidate all client sessions on next refresh. I think the warning is incorrect.
(though I have to manually expire and delete through redis, not the admin plugin, which seems to require db)
(currently trying to migrate from next-auth 5 beta => better-auth)