Skip to content

Commit

Permalink
Merge branch 'main' into jacek/async-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekradko committed Oct 10, 2024
2 parents 2c98bb2 + 1b573c6 commit 42e8e5c
Show file tree
Hide file tree
Showing 71 changed files with 2,747 additions and 2,713 deletions.
5 changes: 0 additions & 5 deletions .changeset/shiny-files-smash.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/stupid-cherries-cry.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/three-timers-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/elements': minor
---

Adds `restricted` Step for restricted sign-up mode
5 changes: 0 additions & 5 deletions .changeset/twenty-kids-speak.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/unlucky-crabs-hunt.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/young-llamas-prove.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
run: |
if [ "${{ matrix.node-version }}" == "18" ]; then
echo "Running tests on Node 18 only for packages with LTS support."
npx turbo test $TURBO_ARGS --filter="@clerk/astro" --filter="@clerk/backend" --filter="@clerk/express" --filter="@clerk/nextjs" --filter="@clerk/clerk-react" --filter="@clerk/fastify" --filter="@clerk/clerk-sdk-node" --filter="@clerk/shared" --filter="@clerk/remix" --filter="@clerk/tanstack-start" --filter="@clerk/elements"
npx turbo test $TURBO_ARGS --filter="@clerk/astro" --filter="@clerk/backend" --filter="@clerk/express" --filter="@clerk/nextjs" --filter="@clerk/clerk-react" --filter="@clerk/clerk-sdk-node" --filter="@clerk/shared" --filter="@clerk/remix" --filter="@clerk/tanstack-start" --filter="@clerk/elements"
else
echo "Running tests for all packages on Node 20."
npx turbo test $TURBO_ARGS
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Would you like to work on Open Source software and help maintain this repository
This repository contains the SDKs for environment/platforms that Clerk supports. For example, if you want to use Clerk with Node.js you can install:

```sh
npm install @clerk/clerk-sdk-node
npm install @clerk/backend
# or
yarn add @clerk/clerk-sdk-node
yarn add @clerk/backend
# or
pnpm add @clerk/clerk-sdk-node
pnpm add @clerk/backend
```

## 🎓 Learning Clerk
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { auth } from '@clerk/nextjs/server';

export default function Home({ params }: { params: { id: string } }) {
const { orgId } = auth();

if (params.id != orgId) {
console.log('Mismatch - returning nothing for now...', params.id, orgId);
}

console.log("I'm the server and I got this id: ", orgId);

return (
<>
<p>Org-specific home</p>
<p>From auth(), I know your org id is: {orgId}</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { auth } from '@clerk/nextjs/server';

export default function Home({ params }: { params: { id: string } }) {
const { orgId } = auth();

if (params.id != orgId) {
console.log('Mismatch - returning nothing for now...', params.id, orgId);
}

console.log("I'm the server and I got this id: ", orgId);

return (
<>
<p>Org-specific settings</p>
<p>From auth(), I know your org id is: {orgId}</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { auth } from '@clerk/nextjs/server';

export default function Home({ params }: { params: { slug: string } }) {
const { orgSlug } = auth();

if (params.slug != orgSlug) {
console.log('Mismatch - returning nothing for now...', params.slug, orgSlug);
}

console.log("I'm the server and I got this slug: ", orgSlug);

return (
<>
<p>Org-specific home</p>
<p>From auth(), I know your org slug is: {orgSlug}</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { auth } from '@clerk/nextjs/server';

export default function Home({ params }: { params: { slug: string } }) {
const { orgSlug } = auth();

if (params.slug != orgSlug) {
console.log('Mismatch - returning nothing for now...', params.slug, orgSlug);
}

console.log("I'm the server and I got this slug: ", orgSlug);

return (
<>
<p>Org-specific settings</p>
<p>From auth(), I know your org slug is: {orgSlug}</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { auth } from '@clerk/nextjs/server';

export default function Home(): {} {
const { orgId } = auth();

if (orgId != null) {
console.log('Oh no, this page should only activate on the personal account!');
}

return (
<>
<p>Welcome to your personal account</p>
</>
);
}
16 changes: 15 additions & 1 deletion integration/testUtils/handshake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,13 @@ export function generateConfig({ mode, matchedKeys = true }: { mode: 'test' | 'l
exp: number;
nbf: number;
};
const generateToken = ({ state }: { state: 'active' | 'expired' | 'early' }) => {
const generateToken = ({
state,
extraClaims,
}: {
state: 'active' | 'expired' | 'early';
extraClaims?: Map<string, any>;
}) => {
const claims = { sub: 'user_12345' } as Claims;

const now = Math.floor(Date.now() / 1000);
Expand All @@ -121,6 +127,14 @@ export function generateConfig({ mode, matchedKeys = true }: { mode: 'test' | 'l
claims.nbf = now - 10 + 600;
claims.exp = now + 60 + 600;
}

// Merge claims with extraClaims
if (extraClaims) {
for (const [key, value] of extraClaims) {
claims[key] = value;
}
}

return {
token: jwt.sign(claims, rsa.private, {
algorithm: 'RS256',
Expand Down
Loading

0 comments on commit 42e8e5c

Please sign in to comment.