Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(iam): updating score URL #2925

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
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
Loading