Fix wallet.html redirect issue

- Change token check from 'access_token' to 'authToken' in wallet.html
- Add wallet.html to protected pages list in app.js
- Fix token name consistency across the web app
parent ce08c4ed
...@@ -1827,10 +1827,11 @@ async function refreshAccessToken() { ...@@ -1827,10 +1827,11 @@ async function refreshAccessToken() {
// Initialize wallet and profile on protected pages // Initialize wallet and profile on protected pages
document.addEventListener('DOMContentLoaded', async function() { document.addEventListener('DOMContentLoaded', async function() {
const token = localStorage.getItem('access_token'); const token = localStorage.getItem('authToken');
const isProtectedPage = window.location.pathname.includes('player.html') || const isProtectedPage = window.location.pathname.includes('player.html') ||
window.location.pathname.includes('broker.html') || window.location.pathname.includes('broker.html') ||
window.location.pathname.includes('profile.html'); window.location.pathname.includes('profile.html') ||
window.location.pathname.includes('wallet.html');
if (token && isProtectedPage) { if (token && isProtectedPage) {
await getProfile(); await getProfile();
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
// Initialize wallet page // Initialize wallet page
document.addEventListener('DOMContentLoaded', async function() { document.addEventListener('DOMContentLoaded', async function() {
const token = localStorage.getItem('access_token'); const token = localStorage.getItem('authToken');
if (!token) { if (!token) {
window.location.href = 'index.html'; window.location.href = 'index.html';
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment