feat(frontend): added account and appearance tabs

This commit is contained in:
ribardej
2025-10-15 11:00:47 +02:00
parent eb087e457c
commit f208e73986
5 changed files with 146 additions and 61 deletions

View File

@@ -8,6 +8,18 @@ function App() {
const [hasToken, setHasToken] = useState<boolean>(!!localStorage.getItem('token'));
useEffect(() => {
// Handle OAuth callback: /oauth-callback?access_token=...&token_type=...
if (window.location.pathname === '/oauth-callback') {
const params = new URLSearchParams(window.location.search);
const token = params.get('access_token');
if (token) {
localStorage.setItem('token', token);
setHasToken(true);
}
// Clean URL and redirect to home
window.history.replaceState({}, '', '/');
}
const onStorage = (e: StorageEvent) => {
if (e.key === 'token') setHasToken(!!e.newValue);
};