Skip to content

Commit 60fd09c

Browse files
committed
Add support for a tooltip warning admins that this scope is required for refresh tokens.
1 parent 9c50a7c commit 60fd09c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

packages/web/src/app/(app)/settings/workspaceAskAgent/workspaceAskAgentPage.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { Label } from "@/components/ui/label";
2222
import { Separator } from "@/components/ui/separator";
2323
import { Skeleton } from "@/components/ui/skeleton";
2424
import { Textarea } from "@/components/ui/textarea";
25+
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
2526
import { checkMcpServerDynamicClientRegistration, createMcpServer, createStaticOAuthMcpServer, deleteMcpServer, updateMcpServerOAuthScopes } from "@/ee/features/chat/mcp/actions";
2627
import { ConnectMcpButton } from "@/ee/features/chat/mcp/components/connectMcpButton";
2728
import { ConnectorCard } from "@/ee/features/chat/mcp/components/connectorCard";
@@ -31,7 +32,7 @@ import { buildMcpOAuthScopeEntries, getMcpRequestedOAuthScopes, normalizeMcpRequ
3132
import { pluralize } from "@/features/chat/mcp/utils";
3233
import { cn, isServiceError } from "@/lib/utils";
3334
import { useQuery, useQueryClient } from "@tanstack/react-query";
34-
import { AlertTriangleIcon, CableIcon, CopyIcon, KeyRoundIcon, Loader2, MoreHorizontalIcon, PlusIcon, Trash2Icon, WrenchIcon } from "lucide-react";
35+
import { AlertTriangleIcon, CableIcon, CopyIcon, InfoIcon, KeyRoundIcon, Loader2, MoreHorizontalIcon, PlusIcon, Trash2Icon, WrenchIcon } from "lucide-react";
3536
import { PrefabConnectorPopover } from "@/ee/features/chat/mcp/components/prefabConnectorPopover";
3637
import Markdown from "react-markdown";
3738
import { getStaticOAuthDescription, type PrefabMcpServer } from "@/ee/features/chat/mcp/prefabMcpServers";
@@ -154,6 +155,18 @@ function OAuthScopesInput({
154155
aria-label={`Request ${scope}`}
155156
/>
156157
<span className="break-all font-mono text-xs">{scope}</span>
158+
{scope === OFFLINE_ACCESS_SCOPE && (
159+
<Tooltip>
160+
<TooltipTrigger asChild>
161+
<span className="shrink-0 text-muted-foreground" onClick={(event) => event.preventDefault()}>
162+
<InfoIcon className="h-3.5 w-3.5" />
163+
</span>
164+
</TooltipTrigger>
165+
<TooltipContent className="max-w-64">
166+
Required for refresh tokens. Without this scope, users must re-authenticate whenever their access token expires, and some connectors reject authorization entirely.
167+
</TooltipContent>
168+
</Tooltip>
169+
)}
157170
</label>
158171
{onRemoveOAuthScope && (
159172
<Button

0 commit comments

Comments
 (0)