Commit 41ab24d
committed
feat(graphile): propagate jwt.claims.session_id to pgSettings
Pairs with constructive-io/constructive-db#908, which adds session_id
to the RETURNS TABLE of authenticate() and authenticate_strict().
Now that req.token.session_id is populated by the auth middleware,
surface it as "jwt.claims.session_id" on the request transaction so
jwt_private.current_session_id() returns a real value.
Without this, every session-scoped DB procedure (sign_out,
revoke_session, extend_token_expires, verify_password, verify_totp,
require_step_up, webauthn_*) silently matches zero rows — the MFA
step-up window in particular never elevates because verify_password
updates sessions.last_password_verified WHERE id = NULL.
- types.ts: add session_id?: string to ConstructiveAPIToken
- graphile.ts: set pgSettings['jwt.claims.session_id'] when present1 parent 15a46bc commit 41ab24d
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments