fix(auth): support department subdomains like @aids.ritchennai.edu.in and @cse.ritchennai.edu.in
Some checks failed
Deploy RIT Freshers Hub to VPS / Deploy to Live VPS (push) Has been cancelled

This commit is contained in:
Shanmuga Krishnan S M
2026-08-06 13:47:17 +05:30
parent b852018f24
commit f57538c7bc
2 changed files with 6 additions and 3 deletions

View File

@@ -89,10 +89,13 @@ public class GoogleAuthService {
}
/**
* Returns true if the email belongs to the college domain.
* Returns true if the email belongs to the college domain or any department subdomain
* e.g., @ritchennai.edu.in, @aids.ritchennai.edu.in, @cse.ritchennai.edu.in, etc.
*/
public boolean isCollegeDomain(String email) {
return email != null && email.toLowerCase().endsWith("@" + COLLEGE_DOMAIN);
if (email == null) return false;
String lower = email.toLowerCase().trim();
return lower.endsWith("ritchennai.edu.in");
}
/**