@furystack/core
Version:
Core FuryStack package
17 lines • 670 B
JavaScript
import { defineService } from '@furystack/inject';
/**
* DI token for the current {@link IdentityContext}. Scoped — each injector
* scope resolves and caches its own context. Default factory is
* unauthenticated; rebind on the request scope to inject an authenticated
* identity.
*/
export const IdentityContext = defineService({
name: '@furystack/core/IdentityContext',
lifetime: 'scoped',
factory: () => ({
isAuthenticated: () => Promise.resolve(false),
isAuthorized: () => Promise.resolve(false),
getCurrentUser: () => Promise.reject(new Error('No IdentityContext')),
}),
});
//# sourceMappingURL=identity-context.js.map