Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

621 B
Raw Blame
import { UserIdentityProvider } from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
import { userIdentityService } from '../authentication/user-identity/user-identity-service'
import { userService } from '../user/user-service'

export const userIdentityHelper = (log: FastifyBaseLogger) => ({
    async isUserEmbedded(userId: string): Promise<boolean> {
        const user = await userService(log).getOneOrFail({ id: userId })
        const userIdentity = await userIdentityService(log).getOneOrFail({ id: user.identityId })
        return userIdentity.provider === UserIdentityProvider.JWT
    },
})