Conversation
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a collections-specific authentication wall (modal) and wires it into common collections entry points so unauthenticated users are prompted to sign in instead of being immediately redirected.
Changes:
- Introduces
LfxCollectionAuthWallmodal and uses it from My Collections, Like, Duplicate, and Create Collection entry points. - Replaces direct
login(redirectTo)redirects with local “open auth wall” state in several flows. - Always exposes the “My Collections” tab (with the page now responsible for gating access via the auth wall).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/app/pages/collection/my-collections/index.vue | Shows the collections auth wall when visiting My Collections unauthenticated |
| frontend/app/components/shared/components/like-button.vue | Opens auth wall when liking while unauthenticated |
| frontend/app/components/modules/collection/store/duplicate-collection.store.ts | Adds store state to open auth wall instead of redirecting on duplicate |
| frontend/app/components/modules/collection/store/collections.store.ts | Stops auto-login redirect in addLikedCollection when unauthenticated |
| frontend/app/components/modules/collection/config/collection-type-config.ts | Always includes “My Collections” tab |
| frontend/app/components/modules/collection/components/create-modal/duplicate-collection-global.vue | Renders auth wall bound to duplicate-collection store state |
| frontend/app/components/modules/collection/components/create-modal/create-button.vue | Always shows Create button; opens auth wall if not signed in |
| frontend/app/components/modules/collection/components/auth-wall/collection-auth-wall.vue | New modal component prompting sign-in and showing social proof |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <div class="bg-white lg:!pb-30 pb-20 lg:!-mb-30 -mb-20 flex-grow"> | ||
| <lfx-collection-list-view type="my-collections" /> | ||
| </div> |
There was a problem hiding this comment.
lfx-collection-list-view is still rendered even when the auth wall is shown. For unauthenticated users this will trigger the My Collections query and can surface error toasts/401s behind the modal (and fetchMyCollections is currently enabled regardless of user.value). Consider gating the list view (or its data fetch) behind authentication (e.g., render the list view only when isAuthenticated is true, or when showAuthWall is false).
| onMounted(() => { | ||
| const route = useRoute(); | ||
| const isAuthCallback = route.query.auth === 'success' || route.query.auth === 'logout'; | ||
|
|
||
| if (!isAuthCallback && !isAuthenticated.value) { | ||
| login(window.location.pathname + window.location.search + window.location.hash); | ||
| showAuthWall.value = true; |
There was a problem hiding this comment.
showAuthWall is set only once in onMounted() based on the current value of isAuthenticated. Since useAuth() populates auth state asynchronously (useAsyncData with lazy: true), this can open the auth wall for already-authenticated users and it will never auto-close when isAuthenticated flips to true. Consider watching isAuthenticated (and/or awaiting an auth refresh) and deriving showAuthWall reactively so it closes when the user becomes authenticated.
| onMounted(async () => { | ||
| try { | ||
| const data = await $fetch<Pagination<Collection>>('/api/collection', { | ||
| params: { type: 'community', sort: 'likeCount_desc', pageSize: 10 }, | ||
| }); |
There was a problem hiding this comment.
The auth wall fetches top community collections on every mount (onMounted + $fetch('/api/collection', ...)). Since this component is commonly rendered via v-if (mount/unmount per open), opening the wall repeatedly will repeatedly hit the API and delay rendering. Consider caching the result (module-level ref), using useAsyncData/useQuery with a stable key + staleTime, or otherwise avoiding refetching when topAuthors is already populated.
No description provided.