- ID de l'analyse :
- b847a1d1-b8f6-468a-b5bf-0441727e0d06Terminée
- URL soumise :
- https://yxng.cc/invite/AL47UH
- Fin du rapport :
Liens : 0 trouvé(s)
Liens sortants identifiés à partir de la page
Variables JavaScript : 8 trouvée(s)
Les variables JavaScript globales chargées dans l'objet fenêtre d'une page sont des variables déclarées en dehors des fonctions et accessibles depuis n'importe quel endroit du code au sein du champ d'application actuel
Nom | Type |
---|---|
onbeforetoggle | object |
documentPictureInPicture | object |
onscrollend | object |
isValidInput | function |
generateCaptcha | function |
setCaptcha | function |
validateCaptcha | function |
register | function |
Messages de journal de console : 4 trouvé(s)
Messages consignés dans la console web
Type | Catégorie | Enregistrement |
---|---|---|
log | other |
|
verbose | dom |
|
verbose | dom |
|
log | other |
|
HTML
Le corps HTML de la page en données brutes
<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paradise</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #121212;
color: #e0e0e0;
margin: 0;
}
.container {
background-color: #1e1e1e;
padding: 40px;
border-radius: 12px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
width: 90%;
max-width: 400px;
transition: transform 0.3s ease-in-out;
}
.container:hover {
transform: scale(1.02);
}
.form-group {
width: 100%;
margin-bottom: 20px;
}
.form-group h2 {
margin-bottom: 20px;
color: #ffffff;
text-align: center;
font-size: 24px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #ffffff;
font-size: 14px;
}
.form-group input {
width: calc(100% - 24px);
padding: 12px;
margin-bottom: 10px;
border: none;
border-radius: 6px;
background-color: #2c2c2c;
color: #e0e0e0;
font-size: 16px;
transition: background-color 0.3s ease-in-out;
}
.form-group input:focus {
outline: none;
background-color: #3c3c3c;
}
.form-group button {
width: calc(100% - 24px);
display: block;
padding: 12px;
border: none;
border-radius: 6px;
background-color: #ffffff;
color: #121212;
font-weight: bold;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s ease-in-out;
margin: 0 auto;
}
.form-group button:hover {
background-color: #c4c4c4;
}
.toggle-link {
display: block;
margin-top: 10px;
color: #ffffff;
cursor: pointer;
text-align: center;
font-size: 14px;
transition: color 0.3s ease-in-out;
}
.toggle-link:hover {
color: #949494;
}
</style>
</head>
<body>
<div class="container">
<div id="register-form" class="form-group" data-captcha-answer="16">
<h2>Register</h2>
<label for="register-username">Username</label>
<input type="text" id="register-username" name="username" required="">
<label for="register-password">Password</label>
<input type="password" id="register-password" name="password" required="">
<label for="register-repeat-password">Repeat Password</label>
<input type="password" id="register-repeat-password" name="repeat-password" required="">
<label for="register-captcha">What is <span id="register-captcha-question">8 + 8</span>?</label>
<input type="text" id="register-captcha" name="captcha" required="">
<button type="button" onclick="register()">Register</button>
<span class="toggle-link" onclick="window.location.href='/login'">Already have an account? Login</span>
</div>
</div>
<script>
function isValidInput(input) {
const regex = /^[a-zA-Z0-9_ ]{5,15}$/;
return regex.test(input);
}
function generateCaptcha() {
const num1 = Math.floor(Math.random() * 10);
const num2 = Math.floor(Math.random() * 10);
return { question: `${num1} + ${num2}`, answer: num1 + num2 };
}
function setCaptcha(formId, questionId) {
const captcha = generateCaptcha();
document.getElementById(questionId).innerText = captcha.question;
document.getElementById(formId).dataset.captchaAnswer = captcha.answer;
}
function validateCaptcha(formId, inputId) {
const form = document.getElementById(formId);
const userAnswer = document.getElementById(inputId).value;
return parseInt(userAnswer) === parseInt(form.dataset.captchaAnswer);
}
function register() {
const username = document.getElementById('register-username').value;
const password = document.getElementById('register-password').value;
const repeatPassword = document.getElementById('register-repeat-password').value;
const captchaValid = validateCaptcha('register-form', 'register-captcha');
const referralCode = sessionStorage.getItem('referralCode') || '';
if (!username || !password || !repeatPassword || !captchaValid) {
alert('Please fill in all fields and answer the captcha correctly.');
return;
}
if (password !== repeatPassword) {
alert('Passwords do not match.');
return;
}
if (!isValidInput(username) || !isValidInput(password)) {
alert('Username and password must be 5-15 letters or numbers.');
return;
}
fetch('/register', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: `username=${username}&password=${password}&referralCode=${referralCode}`
})
.then(response => {
if (response.redirected) {
window.location.href = response.url; // Redirect to the appropriate page
} else {
return response.text();
}
})
.then(data => {
if (data === 'Username already taken.') {
alert('Username already taken. Please choose another one.');
} else if (data && data !== 'User registered successfully') {
alert('Registration failed. Please try again.');
} else {
window.location.href = '/dashboard'; // Redirect to dashboard after successful registration
}
});
}
document.addEventListener('DOMContentLoaded', () => {
setCaptcha('register-form', 'register-captcha-question');
// Capture referral code from the URL
const urlParams = new URLSearchParams(window.location.search);
const referralCode = urlParams.get('referralCode') || window.location.pathname.split('/').pop();
if (referralCode) {
console.log('Referral code from URL:', referralCode);
sessionStorage.setItem('referralCode', referralCode);
}
// Check if there is a referral code in the session
fetch('/getReferralCodeFromSession')
.then(response => response.json())
.then(data => {
if (data.referralCode) {
console.log('Referral code from session:', data.referralCode);
sessionStorage.setItem('referralCode', data.referralCode);
}
})
.catch(err => {
console.error('Failed to fetch referral code from session:', err);
});
});
</script>
</body></html>