Skip to content

[server] fix GitHub Education API call #13082

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

Merged
merged 1 commit into from
Sep 19, 2022
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
3 changes: 2 additions & 1 deletion components/server/ee/src/user/eligibility-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ export class EligibilityService {
logCtx,
`fetching the GitHub Education API failed with status ${rawResponse.status}: ${rawResponse.statusText}`,
);
return { student: false, faculty: false };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the missing return avoids running into parse error.

}
const result: GitHubEducationPack = JSON.parse(await rawResponse.text());
const result: GitHubEducationPack = await rawResponse.json();
if (result.student && result.faculty) {
// That violates the API contract: `student` and `faculty` need to be mutually exclusive
log.warn(
Expand Down