Skip to content

Commit f2e42a6

Browse files
committed
Corrected validation url
1 parent 0fce98a commit f2e42a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/logic/codefresh.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,13 @@ export class Codefresh {
5252

5353
async validateCredentials(cfCreds: CodefreshCredentials) {
5454
logger.info('Validating Codefresh credentials...');
55-
const tokenID = cfCreds.headers['Authorization'].split('.')[0];
56-
const response = await fetch(`${cfCreds.baseUrl}/auth/key/${tokenID}`, {
55+
const response = await fetch(`${cfCreds.baseUrl}/runtime-environments`, {
5756
method: 'GET',
5857
headers: cfCreds.headers,
5958
});
6059

6160
if (!response.ok) {
62-
logger.error(`Invalid Codefresh credentials. Status: ${response.status}`);
61+
logger.error(`Invalid Codefresh credentials. Status: ${JSON.stringify(await response.json())}`);
6362
return false;
6463
}
6564
logger.info('Codefresh credentials are valid.');

0 commit comments

Comments
 (0)