Skip to content

auth redirect flow + protected swipe interactions#18

Merged
moehdotdev merged 1 commit into
mainfrom
dev
Mar 8, 2026
Merged

auth redirect flow + protected swipe interactions#18
moehdotdev merged 1 commit into
mainfrom
dev

Conversation

@moehdotdev

Copy link
Copy Markdown
Owner

this pr improves the authentication flow by redirecting unauthenticated users to sign in and returning them to their original page afterward. it also protects swipe interactions across the app and standardizes the application branding by replacing the previous logo.

auth redirect system

return-to-page authentication
unauthenticated users are now redirected to sign in while preserving their current page so they can return after login.

changes:

  • added usePathname and useSearchParams to capture the current URL
  • implemented getNextUrl() helper to reconstruct the current route
  • added redirectToSignIn() helper that navigates to /signin?next=...

behavior:

  • when a user is redirected to sign in, the current page is encoded in the next parameter
  • after successful authentication, users are returned to the original page they attempted to access

result:
authentication no longer disrupts the user's flow and allows them to continue where they left off.

signin page redirect handling

post-login navigation
the sign-in page now reads the next parameter and redirects users accordingly.

changes:

  • added useSearchParams to read the next query parameter
  • introduced safeNext validation to ensure redirects only occur to internal routes
  • updated login success flow to redirect to the preserved destination instead of the homepage

result:
users automatically return to the page they were on before signing in.

protected swipe interactions

swipe access control
swipe functionality now requires authentication.

changes:

  • swipe handlers now check isAuthenticated
  • unauthenticated swipe attempts trigger a redirect to sign in
  • swipe cards display a not-allowed cursor when the user is not authenticated
  • swipe gestures are blocked until the user signs in

result:
prevents anonymous swipe interactions while guiding users toward authentication.

sign-in prompts in swipe view

user guidance improvements
additional prompts help explain why sign-in is required.

changes:

  • added contextual messages such as “Sign in to start swiping”
  • updated the sign-in button to use the redirect helper
  • prompts appear when users attempt restricted actions

result:
users clearly understand why authentication is required.

product page swipe protection

listing interaction guard
product pages now enforce the same authentication requirement for swipe actions.

changes:

  • added redirect helper to the product details page
  • blocked swipe actions when the user is not authenticated
  • redirected unauthenticated users to the sign-in page with return path

result:
interaction rules are consistent across the app.

branding update

logo replacement
the application logo was updated across the project.

@vercel

vercel Bot commented Mar 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
swap Ready Ready Preview, Comment Mar 8, 2026 1:06pm

@moehdotdev moehdotdev merged commit 8fc5cc1 into main Mar 8, 2026
2 checks passed
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.

1 participant