feat: implement sequential thinking MCP server with tool handling and logging
All checks were successful
Build And Push Image / docker (push) Successful in 2m53s
All checks were successful
Build And Push Image / docker (push) Successful in 2m53s
This commit is contained in:
@@ -1,17 +1,29 @@
|
||||
export default defineNuxtRouteMiddleware((to) => {
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
// Skip auth for public pages
|
||||
if (to.meta.auth === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if user is authenticated
|
||||
const authState = useState('auth.state', () => ({
|
||||
authenticated: false,
|
||||
user: null,
|
||||
groups: [],
|
||||
}));
|
||||
// Use the same auth system as the rest of the app
|
||||
const { isAuthenticated, checkAuth, user } = useAuth();
|
||||
|
||||
console.log('🛡️ Auth middleware running for:', to.path);
|
||||
|
||||
// Ensure auth is checked if user isn't loaded
|
||||
if (!user.value) {
|
||||
console.log('🔄 User not loaded, checking auth...');
|
||||
await checkAuth();
|
||||
}
|
||||
|
||||
if (!authState.value.authenticated) {
|
||||
console.log('✅ Auth middleware check:', {
|
||||
isAuthenticated: isAuthenticated.value,
|
||||
user: user.value?.email
|
||||
});
|
||||
|
||||
if (!isAuthenticated.value) {
|
||||
console.log('❌ User not authenticated, redirecting to login');
|
||||
return navigateTo('/login');
|
||||
}
|
||||
|
||||
console.log('✅ Auth middleware passed, allowing access to:', to.path);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user