Skip to content

Commit adb29b6

Browse files
committed
Accept treatPendingAsSignedOut on getAuth
1 parent e7129b5 commit adb29b6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changeset/tender-brooms-look.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22
'@clerk/nextjs': patch
33
---
44

5-
Introduce `treatPendingAsSignedOut` to `auth` and server-side control components
5+
Introduce `treatPendingAsSignedOut` to `auth`, `getAuth` and server-side control components
66

77
```ts
88
const { userId } = auth({ treatPendingAsSignedOut: false })
99
```
1010

11+
```ts
12+
const { userId } = getAuth(req, { treatPendingAsSignedOut: false })
13+
```
14+
1115
```tsx
1216
<SignedIn treatPendingAsSignedOut={false}>
1317
User has a session that is either pending (requires tasks resolution) or active

packages/nextjs/src/server/createGetAuth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const createSyncGetAuth = ({
6363
noAuthStatusMessage: string;
6464
}) =>
6565
withLogger(debugLoggerName, logger => {
66-
return (req: RequestLike, opts?: { secretKey?: string }): AuthObject => {
66+
return (req: RequestLike, opts?: { secretKey?: string } & PendingSessionOptions): AuthObject => {
6767
if (isTruthy(getHeader(req, constants.Headers.EnableDebug))) {
6868
logger.enable();
6969
}

0 commit comments

Comments
 (0)