Skip to content

Commit

Permalink
fix: allow @iitkgp.ac.in
Browse files Browse the repository at this point in the history
  • Loading branch information
proffapt committed Aug 14, 2024
1 parent fa415e6 commit 7b78070
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions frontend/src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const Form = ({ isAuthenticated, setIsAuthenticated }: FormProps) => {
});
});
} else {
toast.error("Invalid email address. Please use your kgpian email");
toast.error("Invalid email address. Please use your institute email");
return;
}
};
Expand Down Expand Up @@ -127,14 +127,14 @@ const Form = ({ isAuthenticated, setIsAuthenticated }: FormProps) => {
<div className="info">
<div className="title">Heimdall</div>
<p>The gatekeeper to Metakgp services</p>
<p>Please verify using your kgpian email to continue</p>
<p>Please verify using your institute email to continue</p>
</div>
<div className="form">
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Enter your kgpian email"
placeholder="Enter your institute email"
/>
{otpRequested ? (
<>
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ func handleGetOtp(res http.ResponseWriter, req *http.Request) {
return
}

// check for KGPian email
if !strings.HasSuffix(email, "@kgpian.iitkgp.ac.in") {
http.Error(res, "Invalid email domain. Must be @kgpian.iitkgp.ac.in", http.StatusBadRequest)
// check for institute email
if !strings.HasSuffix(email, "@kgpian.iitkgp.ac.in") && !strings.HasSuffix(email, "@iitkgp.ac.in") {
http.Error(res, "Invalid email domain. Only @kgpian.iitkgp.ac.in & @iitkgp.ac.in are allowed", http.StatusBadRequest)
return
}

Expand Down

0 comments on commit 7b78070

Please sign in to comment.