Skip to content

Commit

Permalink
Merge pull request #161 from UAlberta-CMPUT401/feature/auth
Browse files Browse the repository at this point in the history
fix: Signup Error Display Change
  • Loading branch information
monkey567567 authored Dec 3, 2024
2 parents 1b89a3f + bc9001c commit 3ca748e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion frontend/src/app/pages/Signup/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,19 @@ const Signup: React.FC = () => {

} catch (error: any) {
console.error("Error signing up:", error);
setError(error.message);
switch (error.code) {
case "auth/email-already-in-use":
setError("Email is already in use.");
break;
case "auth/weak-password":
setError("Password should be at least 6 characters.");
break;
case "auth/invalid-email":
setError("Invalid Email.");
break;
default:
setError(error.message);
}
} finally {
setIsProcessing(false);
}
Expand Down

0 comments on commit 3ca748e

Please sign in to comment.