UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 971 B
{"version":3,"file":"auth-cache.mjs","names":[],"sources":["../../../../src/services/auth/helpers/auth-cache.ts"],"sourcesContent":["import {\n\tgetNamespaceToken,\n\tinvalidateNamespace,\n} from \"../../../libs/kv/namespaces.js\";\nimport type { ServiceContext } from \"../../../utils/services/types.js\";\n\nconst AUTH_NAMESPACE = \"auth:user\";\n\n/**\n * Returns the current auth cache namespace token.\n * User auth cache keys include this token so one namespace update invalidates every entry.\n */\nexport const getAuthCacheNamespaceToken = (context: ServiceContext) =>\n\tgetNamespaceToken(context, AUTH_NAMESPACE);\n\n/**\n * Invalidates cached user auth state across the app.\n * Used after role, permission, tenant, or user status changes.\n */\nexport const invalidateAuthCache = (context: ServiceContext) =>\n\tinvalidateNamespace(context, AUTH_NAMESPACE);\n"],"mappings":"6FAMA,MAAM,EAAiB,YAMV,EAA8B,GAC1C,EAAkB,EAAS,CAAc,EAM7B,EAAuB,GACnC,EAAoB,EAAS,CAAc"}