-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
63 lines (57 loc) · 1.44 KB
/
script.js
File metadata and controls
63 lines (57 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
mixpanel.init("2f0a504af353b1de551cae3a1e94d637");
let rdsUserEmail;
const callAnalytics = (email) => {
mixpanel.track("Page opened", {
source: "Venus Fly Trap",
data: email || "",
});
document.cookie = "githubLogin=true;domain=.realdevsquad.com;path=/";
const emailField = document.getElementById("emailAddress");
emailField.addEventListener("blur", function () {
mixpanel.track("Email Entered", {
source: "Venus Fly Trap",
data: `${emailField.value}`,
rdsUser: email || "",
});
});
const password = document.getElementById("password");
password.addEventListener("input", function () {
if (password.value.length > 3) {
mixpanel.track("Password Entered", {
source: "Venus Fly Trap",
data: `${emailField.value}`,
rdsUser: email || "",
});
alert(
"Account Hacked!\nDon't worry, we didn't take your data. Be careful of the URLs you visit.\nPlease go back to the main page and try again.\nIt will work this time correctly"
);
password.value = "";
}
});
};
const getRDSEmail = async () => {
const email = await axios
.get(
"https://api.realdevsquad.com/users?profile=true",
{ withCredentials: true },
{
headers: {
"Content-Type": "application/json",
},
}
)
.then((response) => {
return response.data.email;
})
.catch(() => {
return;
});
return email;
};
getRDSEmail()
.then((email) => {
rdsUserEmail = email;
})
.finally(() => {
callAnalytics(rdsUserEmail);
});