Skip to content

Commit b81ca7e

Browse files
committed
Add changeset
1 parent a7343bb commit b81ca7e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.changeset/flat-papers-begin.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@clerk/backend': minor
3+
'@clerk/express': minor
4+
---
5+
6+
Introduce `treatPendingAsSignedOut` option to `getAuth`
7+
8+
```ts
9+
// Both `active` and `pending` sessions will be treated as authenticated when `treatPendingAsSignedOut` is false
10+
const { userId } = getAuth(req, locals, { treatPendingAsSignedOut: false })
11+
```
12+
13+
```ts
14+
// `pending` sessions will be treated as signed-out by default
15+
const { userId } = getAuth(req, locals)
16+
```

packages/express/src/getAuth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ export const getAuth = (req: ExpressRequest, options?: GetAuthOptions): AuthObje
2020
throw new Error(middlewareRequired('getAuth'));
2121
}
2222

23-
// this has to receive an option
2423
return req.auth(options);
2524
};

0 commit comments

Comments
 (0)