feat: enhance mobile compatibility and debugging across authentication and system metrics
All checks were successful
Build And Push Image / docker (push) Successful in 3m18s
All checks were successful
Build And Push Image / docker (push) Successful in 3m18s
This commit is contained in:
@@ -128,9 +128,22 @@ definePageMeta({
|
||||
// Use the auth composable
|
||||
const { user, login, loading: authLoading, error: authError, checkAuth } = useAuth();
|
||||
|
||||
// Check if user is already authenticated
|
||||
// Import mobile utilities for enhanced debugging
|
||||
const { isMobileDevice, debugMobileLogin, runMobileDiagnostics } = await import('~/utils/mobile-utils');
|
||||
|
||||
// Check if user is already authenticated - with mobile-specific handling
|
||||
if (user.value) {
|
||||
await navigateTo('/dashboard');
|
||||
const redirectUrl = '/dashboard';
|
||||
|
||||
if (isMobileDevice()) {
|
||||
console.log('📱 Mobile browser detected, using delayed redirect');
|
||||
debugMobileLogin('Already authenticated redirect');
|
||||
setTimeout(() => {
|
||||
window.location.href = redirectUrl;
|
||||
}, 100);
|
||||
} else {
|
||||
await navigateTo(redirectUrl);
|
||||
}
|
||||
}
|
||||
|
||||
// Reactive data
|
||||
|
||||
Reference in New Issue
Block a user