Added beginning of login functionality

This commit is contained in:
2026-01-05 16:18:59 -05:00
parent 46af0fb959
commit f65d97a50a
7 changed files with 100 additions and 13 deletions

View File

@@ -2,7 +2,7 @@
import { ref, nextTick, onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
import { eventBus } from '@/common/eventBus'
import { authenticateParent, isParentAuthenticated, logout } from '../stores/auth'
import { authenticateParent, isParentAuthenticated, logoutParent } from '../stores/auth'
const router = useRouter()
const show = ref(false)
@@ -42,7 +42,7 @@ const submit = () => {
}
const handleLogout = () => {
logout()
logoutParent()
router.push('/child')
}

View File

@@ -127,6 +127,7 @@ import {
ALREADY_VERIFIED,
} from '@/common/errorCodes'
import { parseErrorResponse, isEmailValid } from '@/common/api'
import { loginUser } from '@/stores/auth' // <-- add this import
const router = useRouter()
@@ -185,6 +186,8 @@ async function submitForm() {
return
}
loginUser() // <-- set user as logged in
await router.push({ path: '/' }).catch(() => (window.location.href = '/'))
} catch (err) {
loginError.value = 'Network error. Please try again.'