Skip to content

Commit

Permalink
Updated class of 2028 student year checker
Browse files Browse the repository at this point in the history
This commit updates the class of 2028 server-specific code to reflect class members’ new statuses as year 1 students according to the MIT directory.
  • Loading branch information
ZelnickB committed Sep 8, 2024
1 parent 772ca29 commit fd301bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routes/api/verification/confirm.endpoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ export function get (req, res) {
const [petrockUserInfo, discordUserInfo] = val[0].value
// BEGIN CLASS OF 2028 SERVER-SPECIFIC CODE
fetch(`https://tlepeopledir.mit.edu/q/${petrockUserInfo.sub}`).then((x) => x.json()).then(directoryResponse => {
if (directoryResponse.result[0] !== undefined && directoryResponse.result[0].student_year === undefined) {
if (directoryResponse.result[0] !== undefined && directoryResponse.result[0].student_year === 1) {
fetch(
`https://discord.com/api/v10/guilds/1186456227425828926/members/${discordUserInfo.id}/roles/1186460225943912539`,
{
method: 'PUT',
headers: {
...botHeaders,
'X-Audit-Log-Reason': 'User verified as student in MIT directory without class year (implies that student is \'28er).'
'X-Audit-Log-Reason': 'User verified as year 1 student in MIT directory.'
}
}
)
Expand Down

0 comments on commit fd301bb

Please sign in to comment.