Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions apps/sim/app/api/copilot/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,23 +123,6 @@ export async function POST(req: NextRequest) {
const session = await getSession()
let authenticatedUserId: string | null = session?.user?.id || null

// If no session, check for API key auth
if (!authenticatedUserId) {
const apiKeyHeader = req.headers.get('x-api-key')
if (apiKeyHeader) {
// Verify API key
const [apiKeyRecord] = await db
.select({ userId: apiKeyTable.userId })
.from(apiKeyTable)
.where(eq(apiKeyTable.key, apiKeyHeader))
.limit(1)

if (apiKeyRecord) {
authenticatedUserId = apiKeyRecord.userId
}
}
}

if (!authenticatedUserId) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
}
Comment on lines 126 to 128
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Removing API key authentication is a breaking change. Any existing integrations using x-api-key header will now fail with 401 Unauthorized. Consider deprecation notice before removal.

Expand Down
4 changes: 2 additions & 2 deletions apps/sim/lib/logs/console/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ const LOG_CONFIG = {
colorize: true,
},
production: {
enabled: false, // Disable all console logs in production
minLevel: LogLevel.ERROR,
enabled: true, // Enable console logs in production
minLevel: LogLevel.INFO, // Show INFO, WARN, and ERROR logs
colorize: false,
},
test: {
Expand Down