mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
Temp logs (#853)
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user