Implement Smart Location: auto-detect user location if preference is enabled, hide location button, and handle permission denial by resetting preference
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
const LoginForm = defineAsyncComponent(() => import('@/components/auth/LoginForm.vue'))
|
||||
const RegisterForm = defineAsyncComponent(() => import('@/components/auth/RegisterForm.vue'))
|
||||
|
||||
@ -14,7 +17,7 @@ const sessionExpiredMessage = ref('')
|
||||
// Detectar si fue redirigido por sesión expirada
|
||||
onMounted(() => {
|
||||
if (route.query.reason === 'session_expired') {
|
||||
sessionExpiredMessage.value = 'Tu sesión ha expirado. Por favor, inicia sesión nuevamente.'
|
||||
sessionExpiredMessage.value = t('auth.sessionExpired')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
@ -29,13 +32,13 @@ onMounted(() => {
|
||||
<!-- Botón volver al mapa -->
|
||||
<button class="back-to-map" @click="router.push('/map')">
|
||||
<span class="material-icons">arrow_back</span>
|
||||
Volver
|
||||
{{ t('auth.back') }}
|
||||
</button>
|
||||
|
||||
<!-- Branding -->
|
||||
<div class="auth-brand">
|
||||
<h1 class="brand-title">SIBU</h1>
|
||||
<p class="brand-subtitle">Sistema de Transporte Público</p>
|
||||
<p class="brand-subtitle">{{ t('auth.brandingSubtitle') }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Card principal -->
|
||||
@ -47,14 +50,14 @@ onMounted(() => {
|
||||
:class="{ 'auth-tab--active': isLogin }"
|
||||
@click="isLogin = true"
|
||||
>
|
||||
Iniciar Sesión
|
||||
{{ t('auth.loginTab') }}
|
||||
</button>
|
||||
<button
|
||||
class="auth-tab"
|
||||
:class="{ 'auth-tab--active': !isLogin }"
|
||||
@click="isLogin = false"
|
||||
>
|
||||
Crear Cuenta
|
||||
{{ t('auth.registerTab') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -72,7 +75,7 @@ onMounted(() => {
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<p class="auth-footer">SIBU © 2026 • Sistema de Transporte de Chiriquí</p>
|
||||
<p class="auth-footer">{{ t('auth.footer') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@ -215,6 +218,7 @@ onMounted(() => {
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
background: var(--bg-secondary);
|
||||
border: 10px 16px;
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.85rem;
|
||||
|
||||
Reference in New Issue
Block a user