fix(ui): remove tailwind CDN and add token auth prompt
This commit is contained in:
@@ -18,7 +18,6 @@ export const prerender = false;
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>🔱 🔱 Valhalla - Spark God Mode</title>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class',
|
||||
@@ -61,14 +60,26 @@ export const prerender = false;
|
||||
// API Helper
|
||||
const api = {
|
||||
async get(endpoint) {
|
||||
const token = localStorage.getItem('godToken') || '';
|
||||
let token = localStorage.getItem('godToken') || '';
|
||||
if (!token) {
|
||||
token = prompt('Enter God Mode Token (GOD_MODE_TOKEN):');
|
||||
if (token) localStorage.setItem('godToken', token);
|
||||
}
|
||||
const res = await fetch(`/api/god/${endpoint}`, {
|
||||
headers: { 'X-God-Token': token }
|
||||
});
|
||||
if (res.status === 401) {
|
||||
localStorage.removeItem('godToken');
|
||||
alert('Invalid token. Please refresh and try again.');
|
||||
}
|
||||
return res.json();
|
||||
},
|
||||
async post(endpoint, data) {
|
||||
const token = localStorage.getItem('godToken') || '';
|
||||
let token = localStorage.getItem('godToken') || '';
|
||||
if (!token) {
|
||||
token = prompt('Enter God Mode Token (GOD_MODE_TOKEN):');
|
||||
if (token) localStorage.setItem('godToken', token);
|
||||
}
|
||||
const res = await fetch(`/api/god/${endpoint}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -77,6 +88,10 @@ export const prerender = false;
|
||||
},
|
||||
body: JSON.stringify(data)
|
||||
});
|
||||
if (res.status === 401) {
|
||||
localStorage.removeItem('godToken');
|
||||
alert('Invalid token. Please refresh and try again.');
|
||||
}
|
||||
return res.json();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user