You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Validate the Authorized Party of a session token
61
+
61
62
Clerk's JWT session token, contains the azp claim, which equals the Origin of the request during token generation. You can provide the middlewares with a list of whitelisted origins to verify against, to protect your application of the subdomain cookie leaking attack. You can find an example below:
Copy file name to clipboardExpand all lines: packages/sdk-node/README.md
+25-27Lines changed: 25 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -547,36 +547,36 @@ The error handling is pretty generic at the moment but more fine-grained errors
547
547
548
548
## Express middleware
549
549
550
-
For usage with <ahref="https://github.com/expressjs/express"target="_blank">Express</a>, this package also exports `ClerkExpressWithSession` (lax) & `ClerkExpressRequireSession` (strict)
550
+
For usage with <ahref="https://github.com/expressjs/express"target="_blank">Express</a>, this package also exports `ClerkExpressWithAuth` (lax) & `ClerkExpressRequireAuth` (strict)
551
551
middlewares that can be used in the standard manner:
Note that by default the error returned will be the Clerk server error encountered (or in case of misconfiguration, the error raised by the SDK itself).
@@ -711,34 +708,35 @@ The aforementioned usage pertains to the singleton case. If you would like to us
711
708
yourself (e.g. named `clerk`), you can use the following syntax instead:
712
709
713
710
```ts
714
-
exportclerk.withSession(handler);
711
+
exportclerk.withAuth(handler);
715
712
// OR
716
-
exportclerk.requireSession(handler);
713
+
exportclerk.requireAuth(handler);
717
714
```
718
715
719
716
## Validate the Authorized Party of a session token
717
+
720
718
Clerk's JWT session token, contains the azp claim, which equals the Origin of the request during token generation. You can provide the middlewares with a list of whitelisted origins to verify against, to protect your application of the subdomain cookie leaking attack. You can find an example below:
@@ -753,10 +751,10 @@ Please consult the following check-list for some potential quick fixes:
753
751
- In development mode, do your frontend & API reside on the same domain? Unless the clerk `__session` is sent to your API server, the SDK will fail to authenticate your user.
754
752
- If you are still experiencing issues, it is advisable to set the `CLERK_LOGGING` environment variable to `true` to get additional logging output that may help identify the issue.
755
753
756
-
Note: The strict middleware variants (i.e. the "require session" variants) will produce an erroneous response if the user is not signed in.
754
+
Note: The strict middleware variants (i.e. the "require auth" variants) will produce an erroneous response if the user is not signed in.
757
755
Please ensure you are not mounting them on routes that are meant to be publicly accessible.
758
756
759
757
## Feedback / Issue reporting
760
758
761
759
Please report issues or open feature request in
762
-
the [github issue section](https://github.com/clerkinc/clerk-sdk-node/issues).
760
+
the [github issue section](https://github.com/clerkinc/javascript/issues).
0 commit comments