Fix duplicate /api/auth/member call and add request deduplication
Remove redundant checkMemberStatus() from coming-soon page since the auth-init plugin already handles it. Add in-flight request deduplication to prevent concurrent calls from any source. Strip debug console.logs.
This commit is contained in:
parent
52bb17e25d
commit
78c592c13a
3 changed files with 22 additions and 40 deletions
|
|
@ -1,20 +1,7 @@
|
|||
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)
|
||||
await checkMemberStatus()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue