Skip to content

feat: sign in wall for collections#1833

Open
gaspergrom wants to merge 1 commit intomainfrom
feat/sigin-modal-collections
Open

feat: sign in wall for collections#1833
gaspergrom wants to merge 1 commit intomainfrom
feat/sigin-modal-collections

Conversation

@gaspergrom
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LfxCollectionAuthWall modal 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.

Comment on lines 6 to 8
<div class="bg-white lg:!pb-30 pb-20 lg:!-mb-30 -mb-20 flex-grow">
<lfx-collection-list-view type="my-collections" />
</div>
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 36 to +41
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;
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +144 to +148
onMounted(async () => {
try {
const data = await $fetch<Pagination<Collection>>('/api/collection', {
params: { type: 'community', sort: 'likeCount_desc', pageSize: 10 },
});
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants