mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-11-25 21:49:02 +01:00
Organized 'users' functionality vertically. (#226)
This commit is contained in:
@@ -26,7 +26,7 @@ To control which pages require users to be authenticated to access them, you can
|
||||
route AccountRoute { path: "/account", to: AccountPage }
|
||||
page AccountPage {
|
||||
authRequired: true,
|
||||
component: import Account from "@src/client/app/AccountPage"
|
||||
component: import Account from "@src/user/AccountPage"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ Go to https://dashboard.stripe.com/test/settings/billing/portal in the Stripe Da
|
||||
REACT_APP_STRIPE_CUSTOMER_PORTAL=<your-test-customer-portal-link>
|
||||
```
|
||||
|
||||
Your Stripe customer portal link is imported into `src/client/app/AccountPage.tsx` and used to redirect users to the Stripe customer portal when they click the `Manage Subscription` button.
|
||||
Your Stripe customer portal link is imported into `src/user/AccountPage.tsx` and used to redirect users to the Stripe customer portal when they click the `Manage Subscription` button.
|
||||
|
||||
```tsx title="src/client/app/AccountPage.tsx" {5} "import.meta.env.REACT_APP_STRIPE_CUSTOMER_PORTAL"
|
||||
```tsx title="src/user/AccountPage.tsx" {5} "import.meta.env.REACT_APP_STRIPE_CUSTOMER_PORTAL"
|
||||
function CustomerPortalButton() {
|
||||
const handleClick = () => {
|
||||
try {
|
||||
@@ -115,4 +115,4 @@ You should see a message like this:
|
||||
> Ready! You are using Stripe API Version [2023-08-16]. Your webhook signing secret is whsec_8a... (^C to quit)
|
||||
```
|
||||
|
||||
copy this secret to your `.env.server` file under `STRIPE_WEBHOOK_SECRET=`.
|
||||
copy this secret to your `.env.server` file under `STRIPE_WEBHOOK_SECRET=`.
|
||||
|
||||
@@ -63,11 +63,12 @@ If you are using a version of the OpenSaaS template with Wasp `v0.11.x` or below
|
||||
│ ├── server/ # Your server code (NodeJS) goes here.
|
||||
│ ├── auth/ # All auth-related pages/components and logic.
|
||||
│ ├── file-upload/ # Logic for uploading files to S3.
|
||||
│ └── payment/ # Logic for handling Stripe payments and webhooks.
|
||||
│ ├── payment/ # Logic for handling Stripe payments and webhooks.
|
||||
│ └── user/ # Logic related to users and their accounts.
|
||||
├── .env.server # Dev environment variables for your server code.
|
||||
├── .env.client # Dev environment variables for your client code.
|
||||
├── .prettierrc # Prettier configuration.
|
||||
├── tailwind.config.js # TailwindCSS configuration.
|
||||
├── tailwind.config.js # TailwindCSS configuration.
|
||||
├── package.json
|
||||
├── package-lock.json
|
||||
|
||||
@@ -131,7 +132,7 @@ All you have to do is define your server-side functions in the `main.wasp` file,
|
||||
├── workers # Functions that run in the background as Wasp Jobs, e.g. daily stats calculation.
|
||||
├── actions.ts # Your server-side write/mutation functions.
|
||||
├── queries.ts # Your server-side read functions.
|
||||
└── utils.ts
|
||||
└── utils.ts
|
||||
```
|
||||
|
||||
## Main Features
|
||||
|
||||
Reference in New Issue
Block a user