Enhance authentication flow: Add authentication-based buttons in AppNavigation for logged-in users, improve member status checks in useAuth, and update join page to automatically redirect to the dashboard after registration. Adjust cookie settings for better development experience.
This commit is contained in:
parent
2ca290d6e0
commit
600fef2b7c
11 changed files with 347 additions and 25 deletions
20
app/plugins/auth-init.client.js
Normal file
20
app/plugins/auth-init.client.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
export default defineNuxtPlugin(async () => {
|
||||
const { memberData, checkMemberStatus } = useAuth()
|
||||
|
||||
console.log('🚀 Auth init plugin running on CLIENT')
|
||||
|
||||
// Only initialize if we don't already have member data
|
||||
if (!memberData.value) {
|
||||
console.log(' - No member data, checking auth status...')
|
||||
|
||||
const isAuthenticated = await checkMemberStatus()
|
||||
|
||||
if (isAuthenticated) {
|
||||
console.log(' - ✅ Authentication successful')
|
||||
} else {
|
||||
console.log(' - ❌ No valid authentication')
|
||||
}
|
||||
} else {
|
||||
console.log(' - ✅ Member data already exists:', memberData.value.email)
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue