Fix : No protected route can be accessed via direct url without signin#349
Fix : No protected route can be accessed via direct url without signin#349calvadev merged 4 commits intoshopstr-eng:mainfrom
Conversation
|
@Aryan0699 is attempting to deploy a commit to the shopstr-eng Team on Vercel. A member of the Team first needs to authorize it. |
|
@GautamBytes Should i also include tests for these ? |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR closes the “auth gap” where protected pages could be accessed directly while logged out by introducing a shared auth-guard hook and wiring it into private routes to prompt sign-in and redirect on dismiss.
Changes:
- Added a reusable
useAuthGuardhook to centralize “logged out → open SignInModal → redirect to /marketplace” behavior. - Updated multiple protected pages to block rendering when logged out and instead show
SignInModal. - Removed direct
SignerContextusage in at least one page in favor of the shared guard hook.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| components/hooks/use-auth-guard.ts | Introduces the shared guard hook that opens the sign-in modal and redirects on dismiss. |
| pages/wallet/index.tsx | Applies the guard and blocks the wallet UI behind the sign-in modal. |
| pages/settings/index.tsx | Applies the guard to the settings landing page. |
| pages/settings/user-profile.tsx | Applies the guard to user-profile settings. |
| pages/settings/shop-profile.tsx | Applies the guard to shop-profile settings. |
| pages/settings/preferences.tsx | Applies the guard to preferences settings. |
| pages/settings/nwc.tsx | Applies the guard to NWC settings. |
| pages/settings/community.tsx | Applies the guard to the community management page. |
| pages/orders/index.tsx | Applies the guard to the orders/messages view. |
| pages/order-summary/index.tsx | Applies the guard and removes direct SignerContext usage. |
| pages/cart/index.tsx | Applies the guard to the cart page. |
| pages/my-listings/index.tsx | Applies the guard to the my-listings page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
Thanks for pointing that out , will have a look into it and will soon get it resolved 👍 |
|
This works right ?
|
… settings api-keys route
|
Done |
|
LGTM Now!! |
|
Hi Gautam, just wanted to clairfy |
yes u can raise a separate pr for this |
Description
It solves the auth-gap where protected pages were accessible via direct URL when logged out.
It introduces a reusable route guard and applies it consistently across all private routes .
components/hooks/use-auth-guard.ts.SignerContext.SignInModalfor logged-out users./marketplacewhen modal is dismissed.Applied guard to all protected pages:
pages/settings/index.tsxpages/settings/user-profile.tsxpages/settings/shop-profile.tsxpages/settings/community.tsxpages/settings/preferences.tsxpages/settings/nwc.tsxpages/wallet/index.tsxpages/orders/index.tsxpages/cart/index.tsxpages/order-summary/index.tsxpages/my-listings/index.tsxResolved or fixed issue
Fixes #343Screenshots (if applicable)
Before
After
Affirmation