🔧 Update client authentication logic and adjust grid layout for responsiveness

This commit is contained in:
2026-01-28 18:38:58 +00:00
parent b7a6a139b0
commit 0f206a0158

View File

@@ -410,24 +410,28 @@ const client = computed(() => {
return createChallongeV1Client(apiKey.value); return createChallongeV1Client(apiKey.value);
} else { } else {
// v2.1 supports OAuth, client credentials, and API key // v2.1 supports OAuth, client credentials, and API key
// Priority: Client Credentials > OAuth > API Key // Priority: OAuth/Client Credentials > API Key
// Note: Client credentials are OAuth tokens with APPLICATION scope permissions
if (isClientCredsAuthenticated.value && clientCredsToken.value) { if (isClientCredsAuthenticated.value && clientCredsToken.value) {
// Use client credentials token (for APPLICATION scope) // Use client credentials token (supports APPLICATION scope)
console.log('🔐 Using Client Credentials token');
return createChallongeV2Client( return createChallongeV2Client(
{ token: clientCredsToken.value, type: AuthType.OAUTH }, { token: clientCredsToken.value, type: AuthType.OAUTH },
{ debug: debugMode.value } { debug: true }
); );
} else if (isAuthenticated.value && accessToken.value) { } else if (isAuthenticated.value && accessToken.value) {
// Use OAuth token if authenticated // Use OAuth token if authenticated (USER scope)
console.log('🔐 Using OAuth token');
return createChallongeV2Client( return createChallongeV2Client(
{ token: accessToken.value, type: AuthType.OAUTH }, { token: accessToken.value, type: AuthType.OAUTH },
{ debug: debugMode.value } { debug: true }
); );
} else if (apiKey.value) { } else if (apiKey.value) {
// Fall back to API key // Fall back to API key (USER scope only)
console.log('🔑 Using API Key');
return createChallongeV2Client( return createChallongeV2Client(
{ token: apiKey.value, type: AuthType.API_KEY }, { token: apiKey.value, type: AuthType.API_KEY },
{ debug: debugMode.value } { debug: true }
); );
} }
return null; return null;
@@ -932,10 +936,16 @@ h2 {
.controls-grid { .controls-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem; gap: 1.5rem;
} }
@media (max-width: 768px) {
.controls-grid {
grid-template-columns: 1fr;
}
}
.control-group { .control-group {
display: flex; display: flex;
flex-direction: column; flex-direction: column;