refactor: remove bookshelf route, consolidate to dashboard
- Update header navigation to link to /dashboard instead of /bookshelf - Update index page auto-redirect to use /dashboard - Remove duplicate route, keeping full-featured dashboard with filters
This commit is contained in:
@@ -39,7 +39,7 @@ func Index(loggedIn bool) templ.Component {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<script src=\"/static/theme.js\"></script><script>\n // Auto-redirect to bookshelf if user is logged in\n document.addEventListener('DOMContentLoaded', function() {\n const token = localStorage.getItem('token');\n if (token) {\n // Validate token by checking profile\n fetch('/api/auth/profile', {\n headers: {\n 'Authorization': `Bearer ${token}`\n }\n })\n .then(response => {\n if (response.ok) {\n // Token is valid, redirect to bookshelf\n window.location.href = '/bookshelf';\n }\n })\n .catch(error => {\n // Silently fail - user stays on homepage\n console.log('Not logged in');\n });\n }\n });\n </script></body></html>")
|
||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<script src=\"/static/theme.js\"></script><script>\n // Auto-redirect to dashboard if user is logged in\n document.addEventListener('DOMContentLoaded', function() {\n const token = localStorage.getItem('token');\n if (token) {\n // Validate token by checking profile\n fetch('/api/auth/profile', {\n headers: {\n 'Authorization': `Bearer ${token}`\n }\n })\n .then(response => {\n if (response.ok) {\n // Token is valid, redirect to dashboard\n window.location.href = '/dashboard';\n }\n })\n .catch(error => {\n // Silently fail - user stays on homepage\n console.log('Not logged in');\n });\n }\n });\n </script></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user