mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
1c54a15e42
Update emailHasLicence for reconfirmation and SAML GitOrigin-RevId: 58daf538d9f0a7db46bb3c1e21f8ca04df095446
29 lines
524 B
JavaScript
29 lines
524 B
JavaScript
function emailHasLicence(emailData) {
|
|
if (!emailData.confirmedAt) {
|
|
return false
|
|
}
|
|
if (!emailData.affiliation) {
|
|
return false
|
|
}
|
|
const affiliation = emailData.affiliation
|
|
const institution = affiliation.institution
|
|
if (!institution) {
|
|
return false
|
|
}
|
|
if (!institution.confirmed) {
|
|
return false
|
|
}
|
|
if (!affiliation.licence) {
|
|
return false
|
|
}
|
|
if (affiliation.pastReconfirmDate) {
|
|
return false
|
|
}
|
|
|
|
return affiliation.licence !== 'free'
|
|
}
|
|
|
|
module.exports = {
|
|
emailHasLicence
|
|
}
|