- Renamed project from PSA-Utils to Pulse - Moved all app files from autotask-app/ to root - Updated package.json name to 'pulse' - Updated Docker container names to pulse-app and pulse-redis - Updated Docker network name to pulse-network
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
export async function GET(request: NextRequest) {
|
|
const password = process.env.AUTOTASK_SECRET || '';
|
|
|
|
// Test with the actual password value
|
|
const testUrl = `${process.env.AUTOTASK_API_URL}/Tickets/entityInformation`;
|
|
|
|
console.log('Password length:', password.length);
|
|
console.log('Password chars:', password.split('').map(c => `${c} (${c.charCodeAt(0)})`).join(', '));
|
|
|
|
const response = await fetch(testUrl, {
|
|
method: 'GET',
|
|
headers: {
|
|
'Username': process.env.AUTOTASK_USERNAME || '',
|
|
'Secret': password,
|
|
'APIIntegrationcode': process.env.AUTOTASK_API_INTEGRATION_CODE || '',
|
|
'Content-Type': 'application/json',
|
|
'Accept': 'application/json',
|
|
},
|
|
});
|
|
|
|
const responseText = await response.text();
|
|
|
|
return NextResponse.json({
|
|
passwordLength: password.length,
|
|
expectedLength: 25, // The actual password should be 25 chars
|
|
passwordMatches: password === '7g*Zf@K0Ns3#q$E4A1~n2#mW$',
|
|
apiResponse: {
|
|
status: response.status,
|
|
statusText: response.statusText,
|
|
body: responseText.substring(0, 200)
|
|
}
|
|
});
|
|
}
|