Total noob here but by browsing the sourcecode, I’ve found the function/regex that checks for the email correctness (permalink). I guess that by looking at the existing code and at the is_email_regex function, you can rather easily add an additional check to make sure the email is bound to the domain you want. No idea if this function/regex is the one the code actually tests email addresses against to check whether they are valid or not
Edit: apparently that function is not used in the registration process, but in the login one. I’m totally cluelessly wandering across the code so someone please correct me if I’m wrong. Apparently the registration process is handled here. I think that if you add an additional check on the email address here, you can obtain the result you’re looking for
if !is_uni_regex(data.email) {
return Err(APIError::err("unauthorized_email_domain").into());
}
…and you’d have to add a new unauthorized_email_domain key to the translations file. Again I hope I’m stressing it enough, do not trust me. There are probably more correct or consistent ways of doing it. I’m just trying to figure out by myself lol
Edit again: as far as I remember, Lemmy doesn’t send any verification url to the user email, so one could just make up an email address using the required domain and the account would be valid
Anyway yes, as AgreeableLandscape said, as long as you respect the AGPL license, you can do whatever you want to the public sourcecode, including adding this kind of verification
Total noob here but by browsing the sourcecode, I’ve found the function/regex that checks for the email correctness (permalink). I guess that by looking at the existing code and at the
is_email_regex
function, you can rather easily add an additional check to make sure the email is bound to the domain you want. No idea if this function/regex is the one the code actually tests email addresses against to check whether they are valid or notEdit: apparently that function is not used in the registration process, but in the login one. I’m totally cluelessly wandering across the code so someone please correct me if I’m wrong. Apparently the registration process is handled here. I think that if you add an additional check on the email address here, you can obtain the result you’re looking for
Something like:
and then in the file I linked above:
…and you’d have to add a new
unauthorized_email_domain
key to the translations file. Again I hope I’m stressing it enough, do not trust me. There are probably more correct or consistent ways of doing it. I’m just trying to figure out by myself lolEdit again: as far as I remember, Lemmy doesn’t send any verification url to the user email, so one could just make up an email address using the required domain and the account would be valid
Anyway yes, as AgreeableLandscape said, as long as you respect the AGPL license, you can do whatever you want to the public sourcecode, including adding this kind of verification
Thanks! Yeah, I figured I would need to put some effort beyond a simple fix. Just more fun I guess :)
Yup this is correct, it would be that easy.