Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Sign Up with Email Providers Other Than Gmail #245

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions client/src/pages/auth/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const SignInPage: React.FC = () => {

useEffect(() => {
const checkEmailExistence = async () => {
if (email && email.endsWith("@gmail.com")) {
const emailPattern = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g;

if (email && emailPattern.test(email)) {
setIsCheckingEmail(true)
try {
const exists = await checkEmailExists(email)
Expand Down Expand Up @@ -109,7 +111,7 @@ const SignInPage: React.FC = () => {
}`}
{...register("email")}
/>
{email && email.endsWith("@gmail.com") && (
{email && (
<span className="absolute inset-y-0 right-0 flex items-center pr-3">
{isCheckingEmail ? (
<span className="loading loading-spinner loading-sm"></span>
Expand Down
7 changes: 4 additions & 3 deletions client/src/pages/auth/SignInPage2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const SignInPage2: React.FC = () => {

useEffect(() => {
const checkEmailExistence = async () => {
if (email && email.endsWith("@gmail.com")) {
const emailPattern = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g;

if (email && emailPattern.test(email)) {
setIsCheckingEmail(true)
try {
const exists = await checkEmailExists(email)
Expand Down Expand Up @@ -118,8 +120,7 @@ const SignInPage2: React.FC = () => {
className={`bg-gray-800 text-white ${errors.email ? "border-red-500" : ""}`}
{...register("email")}
/>
{email &&
email.endsWith("@gmail.com") && (
{email && (
<span className="absolute inset-y-0 right-0 flex items-center pr-3">
{isCheckingEmail ? (
<div className="animate-spin rounded-full h-4 w-4 border-t-2 border-b-2 border-white"></div>
Expand Down
6 changes: 4 additions & 2 deletions client/src/pages/auth/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ const SignUp: React.FC = () => {

useEffect(() => {
const checkEmailAvailability = async () => {
if (email && email.endsWith("@gmail.com")) {
const emailPattern = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g;

if (email && emailPattern.test(email)) {
setIsCheckingEmail(true)
try {
const emailExists = await checkEmailExists(email)
Expand Down Expand Up @@ -239,7 +241,7 @@ const SignUp: React.FC = () => {
}`}
{...register("email")}
/>
{email && email.endsWith("@gmail.com") && (
{email && (
<span className="absolute inset-y-0 right-0 flex items-center pr-3">
{isCheckingEmail ? (
<span className="loading loading-spinner loading-sm"></span>
Expand Down
6 changes: 4 additions & 2 deletions client/src/pages/auth/SignUpPage2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ const SignUp: React.FC = () => {

useEffect(() => {
const checkEmailAvailability = async () => {
if (email && email.endsWith("@gmail.com")) {
const emailPattern = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/g;

if (email && emailPattern.test(email)) {
setIsCheckingEmail(true)
try {
const emailExists = await checkEmailExists(email)
Expand Down Expand Up @@ -258,7 +260,7 @@ const SignUp: React.FC = () => {
className={`bg-gray-800 text-white ${errors.email ? "border-red-500" : ""}`}
{...register("email")}
/>
{email && email.endsWith("@gmail.com") && (
{email && (
<span className="absolute inset-y-0 right-0 flex items-center pr-3">
{isCheckingEmail ? (
<div className="animate-spin rounded-full h-4 w-4 border-t-2 border-b-2 border-white"></div>
Expand Down