Skip to content

Commit

Permalink
Updated_Trusted_mail_services
Browse files Browse the repository at this point in the history
smog-root committed Oct 14, 2024
1 parent 68d11b9 commit a34b57d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion auth.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@ const sign_in_btn = document.querySelector("#sign-in-btn");
const sign_up_btn = document.querySelector("#sign-up-btn");
const container = document.querySelector(".container");

// Allowed email domains for registration
const allowedDomains = ['gmail.com', 'outlook.com', 'yahoo.com', 'hotmail.com' , 'icloud.com' , 'protonmail.com' , 'tutanota.com']; // Add more as needed

sign_up_btn.addEventListener("click", () => {
container.classList.add("sign-up-mode");
});
@@ -42,6 +45,15 @@ document.querySelector(".sign-up-form").addEventListener('submit', function(even
return;
}

// Extract domain from email
const emailDomain = email.split('@')[1];

// Check if email domain is allowed
if (!allowedDomains.includes(emailDomain)) {
alert('Please use an email from a reputable provider (Gmail, Outlook, Yahoo, etc.)');
return; // Prevent registration
}

// Dummy signup logic for demo purposes
localStorage.setItem('username', username);
localStorage.setItem('email', email);
@@ -91,4 +103,4 @@ function checkPasswordStrength() {
}

// Call the checkPasswordStrength function on password input
document.querySelector(".sign-up-form input[type='password']").addEventListener('input', checkPasswordStrength);
document.querySelector(".sign-up-form input[type='password']").addEventListener('input', checkPasswordStrength);

0 comments on commit a34b57d

Please sign in to comment.