forked from boxyhq/saas-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add documentation on how to protect page with specific Stripe Subscri…
…ption Related to boxyhq#1041 Add documentation and code changes to protect a page with a specific Stripe Subscription. * **README.md**: - Add a new section explaining how to protect a page with a specific Stripe Subscription. - Include code examples for checking active Stripe Subscription in `middleware.ts` and `AccessControl.tsx`. * **components/shared/AccessControl.tsx**: - Import `useActiveSubscription` hook. - Add a check for active Stripe Subscription in the `useCanAccess` hook. - Update the `AccessControl` component to include the new check. * **middleware.ts**: - Import `getByCustomerId` from `models/subscription`. - Add a check for active Stripe Subscription before allowing access to protected routes. - Update the `redirectUrl` logic to handle subscription-based access control.
- Loading branch information
1 parent
3f9d726
commit ebf289b
Showing
3 changed files
with
159 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters