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:
@@ -285,12 +285,21 @@ export default defineEventHandler(async (event) => {
|
||||
const cookieParts = cookieString.split(';')[0].split('=');
|
||||
const sessionId = cookieParts[1];
|
||||
|
||||
// Set the cookie using Nuxt's setCookie helper
|
||||
// Set the cookie using Nuxt's setCookie helper with mobile-compatible settings
|
||||
const maxAge = !!rememberMe ? 60 * 60 * 24 * 30 : 60 * 60 * 24 * 7; // 30 days vs 7 days
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
|
||||
console.log('🍪 Setting cookie with mobile-friendly settings:', {
|
||||
secure: isProduction,
|
||||
sameSite: 'lax',
|
||||
maxAge,
|
||||
rememberMe: !!rememberMe
|
||||
});
|
||||
|
||||
setCookie(event, 'monacousa-session', sessionId, {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: 'none',
|
||||
secure: isProduction, // Only secure in production
|
||||
sameSite: 'lax', // Changed from 'none' for mobile compatibility
|
||||
maxAge,
|
||||
path: '/',
|
||||
});
|
||||
|
||||
@@ -22,6 +22,14 @@ export default defineEventHandler(async (event) => {
|
||||
console.log('✅ Valid session found for user:', session.user.email);
|
||||
console.log('🎯 User tier:', session.user.tier);
|
||||
console.log('📋 User groups:', session.user.groups);
|
||||
console.log('👤 User data:', {
|
||||
id: session.user.id,
|
||||
email: session.user.email,
|
||||
name: session.user.name,
|
||||
firstName: session.user.firstName,
|
||||
lastName: session.user.lastName,
|
||||
username: session.user.username
|
||||
});
|
||||
|
||||
return {
|
||||
authenticated: true,
|
||||
|
||||
Reference in New Issue
Block a user