Enforce @ucalgary.ca emails for registration & require login after account creation

This commit is contained in:
Mann Patel
2025-04-22 12:18:10 -06:00
parent 4ba6dfa7be
commit bbddc8566a
4 changed files with 118 additions and 184 deletions

View File

@@ -292,7 +292,8 @@ function App() {
// Set authenticated user
setUser(newUser);
setIsAuthenticated(true);
setIsSignUp(false);
//setIsAuthenticated(true);
// Save to localStorage to persist across refreshes
sessionStorage.setItem("isAuthenticated", "true");
@@ -338,12 +339,11 @@ function App() {
setError("Email and password are required");
setIsLoading(false);
return;
} else if (!formValues.email.endsWith("@ucalgary.ca")) {
setError("Please use your UCalgary email address (@ucalgary.ca)");
setIsLoading(false);
return;
}
// else if (!formValues.email.endsWith("@ucalgary.ca")) {
// setError("Please use your UCalgary email address (@ucalgary.ca)");
// setIsLoading(false);
// return;
// }
try {
if (isSignUp) {
// Handle Sign Up with verification