This commit is contained in:
2025-12-18 10:46:18 -05:00
parent ee311cc120
commit dee5d38b58
3 changed files with 11 additions and 6 deletions

View File

@@ -317,7 +317,7 @@
<h1>📊 PPR Reports</h1>
</div>
<div class="menu-buttons">
<button class="btn btn-secondary" onclick="window.location.href='admin.html'">
<button class="btn btn-secondary" onclick="window.location.href='admin'">
← Back to Admin
</button>
</div>
@@ -466,7 +466,7 @@
}
// No valid cached token, redirect to admin
window.location.href = 'admin.html';
window.location.href = 'admin';
}
function logout() {
@@ -475,13 +475,13 @@
localStorage.removeItem('ppr_token_expiry');
accessToken = null;
currentUser = null;
window.location.href = 'admin.html';
window.location.href = 'admin';
}
// Enhanced fetch wrapper with token expiry handling
async function authenticatedFetch(url, options = {}) {
if (!accessToken) {
window.location.href = 'admin.html';
window.location.href = 'admin';
throw new Error('No access token available');
}