Fix mobile browser reload loops by making query parameters static
All checks were successful
Build And Push Image / docker (push) Successful in 3m31s
All checks were successful
Build And Push Image / docker (push) Successful in 3m31s
Convert reactive computed() query parameters to static ref() values in auth pages to prevent infinite reload loops on mobile browsers. Affects setup-password, verify-expired, and verify-success pages.
This commit is contained in:
@@ -183,10 +183,10 @@ const showConfirmPassword = ref(false);
|
||||
const password = ref('');
|
||||
const confirmPassword = ref('');
|
||||
|
||||
// Get query parameters
|
||||
// Get query parameters - static to prevent reload loops
|
||||
const route = useRoute();
|
||||
const email = computed(() => route.query.email as string || '');
|
||||
const token = computed(() => route.query.token as string || '');
|
||||
const email = ref((route.query.email as string) || '');
|
||||
const token = ref((route.query.token as string) || '');
|
||||
|
||||
// Form ref
|
||||
const formRef = ref();
|
||||
|
||||
@@ -135,8 +135,9 @@ definePageMeta({
|
||||
});
|
||||
|
||||
// Get query parameters
|
||||
// Get query parameters - static to prevent reload loops
|
||||
const route = useRoute();
|
||||
const reason = computed(() => route.query.reason as string || 'expired');
|
||||
const reason = ref((route.query.reason as string) || 'expired');
|
||||
|
||||
// Reactive data
|
||||
const email = ref('');
|
||||
|
||||
@@ -98,10 +98,10 @@ definePageMeta({
|
||||
middleware: 'guest'
|
||||
});
|
||||
|
||||
// Get query parameters
|
||||
// Get query parameters - static to prevent reload loops
|
||||
const route = useRoute();
|
||||
const email = computed(() => route.query.email as string || '');
|
||||
const partialWarning = computed(() => route.query.warning === 'partial');
|
||||
const email = ref((route.query.email as string) || '');
|
||||
const partialWarning = ref(route.query.warning === 'partial');
|
||||
|
||||
// Static device detection - no reactive dependencies
|
||||
const deviceInfo = getStaticDeviceInfo();
|
||||
@@ -109,15 +109,8 @@ const deviceInfo = getStaticDeviceInfo();
|
||||
// Static CSS classes - computed once, never reactive
|
||||
const containerClasses = ref(getDeviceCssClasses('verification-success'));
|
||||
|
||||
// Setup password URL for Keycloak - Fixed URL structure
|
||||
const setupPasswordUrl = computed(() => {
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const keycloakIssuer = runtimeConfig.public.keycloakIssuer || 'https://auth.monacousa.org/realms/monacousa';
|
||||
|
||||
// Use the correct Keycloak account management URL
|
||||
// Remove the hash fragment that was causing 404 errors
|
||||
return `${keycloakIssuer}/account/`;
|
||||
});
|
||||
// Static setup password URL - no reactive dependencies
|
||||
const setupPasswordUrl = 'https://auth.monacousa.org/realms/monacousa/account/';
|
||||
|
||||
// Set page title with mobile viewport optimization
|
||||
useHead({
|
||||
@@ -146,7 +139,7 @@ onMounted(() => {
|
||||
console.log('[verify-success] Email verification completed', {
|
||||
email: email.value,
|
||||
partialWarning: partialWarning.value,
|
||||
setupPasswordUrl: setupPasswordUrl.value
|
||||
setupPasswordUrl: setupPasswordUrl
|
||||
});
|
||||
|
||||
// Apply mobile Safari optimizations early
|
||||
|
||||
Reference in New Issue
Block a user