Skip to content

Commit

Permalink
fix(iam): updating score URL (#2925)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianHymer authored Sep 27, 2024
1 parent e43ffa7 commit b9abca2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions iam/src/utils/scorerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type GetScoreResponse = {
};
};

const apiKey = process.env.CGRANTS_API_TOKEN;

// Use public endpoint and static api key to fetch score
export async function fetchPassportScore(address: string, customScorerId?: number): Promise<Score> {
const scorer_id = customScorerId || Number(process.env.ALLO_SCORER_ID);
Expand All @@ -38,14 +40,12 @@ export async function fetchPassportScore(address: string, customScorerId?: numbe
}

async function requestScore(address: string, scorerId: number): Promise<GetScoreResponse> {
const apiKey = process.env.SCORER_API_KEY;

const getScoreUrl = `${process.env.SCORER_ENDPOINT}/registry/score/${scorerId}/${address}`;
const getScoreUrl = `${process.env.SCORER_ENDPOINT}/ceramic-cache/score/${scorerId}/${address}`;

try {
return await axios.get(getScoreUrl, {
headers: {
"X-API-Key": apiKey,
Authorization: apiKey,
},
});
} catch (error) {
Expand Down

0 comments on commit b9abca2

Please sign in to comment.