Skip to content

Commit e605527

Browse files
committed
yoinked the baked cookie and added some SHA hasing
1 parent 9227ddf commit e605527

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1>EPIC_Tracker</h1>
5656
</p>
5757
</div>
5858
</div>
59-
59+
<script src="./sha.js" ></script>
6060
<script src="./index.js"></script>
6161
</body>
6262

client/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,15 @@ nowFetch().then(response => {
120120
graphics: graphicsRenderer, graphicsVendor: graphicsVendor, pin: response.pin, deviceWidth: deviceWidth,
121121
deviceHeight: deviceHeight
122122
}
123-
const staticData = {
123+
const dynamicData = {
124124
headers: data.headers, city: data.city, country: data.country, timezone: data.timezone,
125125
memory: data.memory, platform: data.platform, hardwareConcurrency: data.hardwareConcurrency,
126126
graphics: graphicsRenderer, graphicsVendor: graphicsVendor, deviceWidth: deviceWidth,
127127
deviceHeight: deviceHeight, language: language, colorDepth: colorDepth
128128
}
129-
const encodedStatic = btoa(JSON.stringify(staticData))
130-
console.log(encodedStatic)
129+
const encodedDinamic = btoa(JSON.stringify(dynamicData))
130+
console.log(encodedDinamic)
131+
console.log("HASH:" + sha1(encodedDinamic))
131132
const ipPhrase = `Your IP address is ${data.ip}.`;
132133
const ispPhrase = `Your network provider is ${data.isp}.`;
133134
const headersPhrase = `${data.headers}.`;
@@ -142,12 +143,6 @@ nowFetch().then(response => {
142143
document.querySelector('.city').textContent = cityPhrase;
143144
document.querySelector('.timezone').textContent = timezonePhrase;
144145
document.querySelector('.pin').textContent = pinPhrase;
145-
bakeCookie(data).then(res => {
146-
document.cookie = `monstercookie=${res.cookie}`
147-
// console.log(document.cookie)
148-
const cookiePhrase = `The cookie I stored to identify you: ${res.cookie}.`;
149-
document.querySelector('.cookie').textContent = cookiePhrase;
150-
})
151146
// weather
152147
weather(data.city).then(weatherData => {
153148
const weatherPhrase = `The weather of your area: ${weatherData.description}.`;

0 commit comments

Comments
 (0)