mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-21 01:51:09 -05:00
feat: major API restructure and Vue.js frontend integration
- Centralize API endpoints in dedicated api app with v1 versioning - Remove individual API modules from parks and rides apps - Add event tracking system with analytics functionality - Integrate Vue.js frontend with Tailwind CSS v4 and TypeScript - Add comprehensive database migrations for event tracking - Implement user authentication and social provider setup - Add API schema documentation and serializers - Configure development environment with shared scripts - Update project structure for monorepo with frontend/backend separation
This commit is contained in:
81
frontend/src/components/auth/AuthManager.vue
Normal file
81
frontend/src/components/auth/AuthManager.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<!-- Login Modal -->
|
||||
<LoginModal
|
||||
:show="showLogin"
|
||||
@close="closeAllModals"
|
||||
@showSignup="switchToSignup"
|
||||
@success="handleAuthSuccess"
|
||||
/>
|
||||
|
||||
<!-- Signup Modal -->
|
||||
<SignupModal
|
||||
:show="showSignup"
|
||||
@close="closeAllModals"
|
||||
@showLogin="switchToLogin"
|
||||
@success="handleAuthSuccess"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch, defineProps, defineEmits } from 'vue'
|
||||
import LoginModal from './LoginModal.vue'
|
||||
import SignupModal from './SignupModal.vue'
|
||||
|
||||
interface Props {
|
||||
show?: boolean
|
||||
initialMode?: 'login' | 'signup'
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
show: false,
|
||||
initialMode: 'login',
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
close: []
|
||||
success: []
|
||||
}>()
|
||||
|
||||
// Initialize reactive state
|
||||
const showLogin = ref(false)
|
||||
const showSignup = ref(false)
|
||||
|
||||
// Define helper functions with explicit function declarations to avoid hoisting issues
|
||||
function closeAllModals() {
|
||||
showLogin.value = false
|
||||
showSignup.value = false
|
||||
emit('close')
|
||||
}
|
||||
|
||||
function switchToLogin() {
|
||||
showSignup.value = false
|
||||
showLogin.value = true
|
||||
}
|
||||
|
||||
function switchToSignup() {
|
||||
showLogin.value = false
|
||||
showSignup.value = true
|
||||
}
|
||||
|
||||
function handleAuthSuccess() {
|
||||
closeAllModals()
|
||||
emit('success')
|
||||
}
|
||||
|
||||
// Watch for prop changes to show the appropriate modal
|
||||
watch(
|
||||
() => props.show,
|
||||
(shouldShow) => {
|
||||
if (shouldShow) {
|
||||
if (props.initialMode === 'signup') {
|
||||
switchToSignup()
|
||||
} else {
|
||||
switchToLogin()
|
||||
}
|
||||
} else {
|
||||
closeAllModals()
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
</script>
|
||||
Reference in New Issue
Block a user