Skip to content
Open
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
11 changes: 10 additions & 1 deletion src/config/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,19 @@ export async function validateRestApiAccess(httpClient, authManager) {
{ path: '/feeds', name: 'Feeds' }
];

// Get baseURL from httpClient for OAuth signature generation
const baseURL = httpClient.defaults.baseURL;

if (!baseURL) {
throw new Error('httpClient baseURL is not configured');
}

const results = [];
for (const endpoint of endpoints) {
try {
const headers = authManager.getAuthHeaders();
// Generate proper OAuth headers with full URL for signature
const fullUrl = `${baseURL}${endpoint.path}`;
const headers = authManager.getAuthHeaders('GET', fullUrl, { per_page: 1 });
await httpClient.get(endpoint.path, {
headers,
params: { per_page: 1 }
Expand Down
1 change: 1 addition & 0 deletions src/tests/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class MockHttpClient {
this.requests = [];
this.responses = new Map();
this.defaultResponse = new MockResponse();
this.defaults = { baseURL: 'https://test.example.com' };
}

/**
Expand Down
Loading