subscriberExternalTokenNotice top-level property

StatusNoticeDefinition subscriberExternalTokenNotice
final

Auth conflict: subscriber using external token.

Implementation

final StatusNoticeDefinition
subscriberExternalTokenNotice = StatusNoticeDefinition(
  id: 'neomage-ai-external-token',
  type: StatusNoticeType.warning,
  isActive: (ctx) =>
      ctx.isSubscriber &&
      (ctx.authTokenSource == 'ANTHROPIC_AUTH_TOKEN' ||
          ctx.authTokenSource == 'apiKeyHelper'),
  render: (ctx, context) {
    final theme = Theme.of(context);
    return Container(
      margin: const EdgeInsets.only(top: 8),
      child: Row(
        children: [
          Icon(Icons.warning_amber, size: 16, color: theme.colorScheme.error),
          const SizedBox(width: 6),
          Expanded(
            child: Text(
              'Auth conflict: Using ${ctx.authTokenSource} instead of Neomage account '
              'subscription token. Either unset ${ctx.authTokenSource}, or run '
              '`neomage /logout`.',
              style: TextStyle(fontSize: 12, color: theme.colorScheme.error),
            ),
          ),
        ],
      ),
    );
  },
);