feat(core): Add chat-specific branding to the shared OAuth consent screen (#37430)

This commit is contained in:
MHMD
2026-08-31 14:35:22 +00:00
committed by GitHub
parent 292f442afa
commit e774ed2e48
3 changed files with 9 additions and 1 deletions
@@ -12,6 +12,7 @@ import type { WorkflowFinderService } from '@/workflows/workflow-finder.service'
import { triggerResourceGate } from '../resource-gate';
import {
CHAT_TRIGGER_CONSENT_HINTS,
CHAT_TRIGGER_SCOPES,
isOAuthProtectedChatTrigger,
resourceUrlToWebhookPath,
@@ -113,7 +114,7 @@ export abstract class ChatTriggerResourceResolverBase implements ProtectedResour
getAllowedRedirectUris: async () => [resourceUrl],
scopes: CHAT_TRIGGER_SCOPES,
displayName: workflowName,
// `uiHints` is IAM-1266's.
uiHints: CHAT_TRIGGER_CONSENT_HINTS,
...triggerResourceGate(this.workflowFinderService, {
audiences,
executeAccessWorkflowId: requireExecute ? workflowId : undefined,
@@ -24,6 +24,12 @@ export const WEBHOOK_TRIGGER_SCOPES: string[] = [];
/** Scopes advertised for per-workflow Chat trigger resources. Empty, like the other triggers. */
export const CHAT_TRIGGER_SCOPES: string[] = [];
/** Consent-screen presentation hints for per-workflow Chat trigger resources. */
export const CHAT_TRIGGER_CONSENT_HINTS: ConsentUiHints = {
icon: 'node:chat-trigger',
consentType: 'chat',
};
/**
* A chat trigger is an OAuth protected resource only in the shape the hosted page can actually
* serve: enabled, published publicly, on the n8n-hosted page rather than the embedded widget, and
@@ -2644,6 +2644,7 @@
"oauth.consentView.firstParty.heading": "\"{resourceName}\" wants to run using your n8n login",
"oauth.consentView.firstParty.description": "Running this {resourceType} executes its workflow using your account and any connected credentials. Only continue if you trust the creator of this {resourceType}.",
"oauth.consentView.firstParty.type.form": "form",
"oauth.consentView.firstParty.type.chat": "chatbot",
"oauth.consentView.firstParty.type.default": "resource",
"oauth.consentView.allowDisabled.trust": "First confirm you recognize and trust the URL above",
"oauth.consentView.allowDisabled.noScopes": "Select at least one scope to grant",