Skip to content

Commit b65b501

Browse files
committed
security: migrando APIs para cloudflare
1 parent e293efd commit b65b501

3 files changed

Lines changed: 9 additions & 16 deletions

File tree

ReturnKey/ReturnKey.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,13 @@ async function GetToken(token)
5353
}
5454

5555
async function VerifyToken(token) {
56-
57-
const URL = 'REMOVED_ENDPOINT_3'
58-
const anomKey = 'REMOVED_KEY'
5956

6057
try
6158
{
62-
const response = await fetch(URL,
63-
{
59+
const response = await fetch('https://returnkey.greenscriptshub.workers.dev', {
6460
method: 'POST',
65-
headers: {'Authorization': `Bearer ${anomKey}`, 'Content-Type': 'application/json'},
66-
body: JSON.stringify({token})
61+
headers: { 'Content-Type': 'application/json' },
62+
body: JSON.stringify({ token })
6763
})
6864

6965
if (!response.ok) {
@@ -90,4 +86,4 @@ function esconderLoader() {
9086
setTimeout(() => loader.remove(), 600);
9187
}
9288

93-
setTimeout(esconderLoader, 5000);
89+
setTimeout(esconderLoader, 7500);

getKey.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
getKey()
22

33
async function getKey() {
4-
const URL = 'REMOVED_ENDPOINT_3'
5-
const anomKey = 'REMOVED_KEY'
6-
7-
const response = await fetch(URL,
8-
{method: 'GET',
9-
headers: {'Authorization': `Bearer ${anomKey}`, 'Content-Type': 'application/json'}}
4+
const response = await fetch('https://getkey.greenscriptshub.workers.dev/', {
5+
method: 'GET',
6+
headers: {'Content-Type': 'application/json'}}
107
)
118

129
if(!response.ok)

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
<!-- STATS -->
7373
<section class="stats" aria-label="Estatísticas">
7474
<div class="scard">
75-
<div class="slabel">Keys geradas (30 dias)</div>
76-
<div class="sval" id="keys">Carregando</div>
75+
<div class="slabel">Chaves Geradas</div>
76+
<div class="sval" id="keys">1.2K</div>
7777
<div class="sunit">chaves válidas entregues</div>
7878
</div>
7979
<div class="scard">

0 commit comments

Comments
 (0)