Skip to content

Commit

Permalink
Actually get this upgrade working
Browse files Browse the repository at this point in the history
  • Loading branch information
dfellis committed Apr 26, 2022
1 parent b11573b commit 305b5c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"express": "^4.17.1",
"express-jwt": "^7.5.0",
"graphile-worker": "^0.13.0",
"jwks-rsa": "^2.0.4",
"jwks-rsa": "^2.1.0",
"pg": "^8.7.3",
"postgraphile": "^4.12.9",
"reflect-metadata": "^0.1.13",
Expand Down
5 changes: 3 additions & 2 deletions src/router/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as express from 'express'
import jwt from 'express-jwt'
import { expressjwt as jwt, GetVerificationKey, } from 'express-jwt'
import jwksRsa from 'jwks-rsa'

import config from '../config'
Expand All @@ -13,9 +13,10 @@ const v1 = express.Router();
v1.use(express.json({ limit: '10000MB' }));
if (config.auth) {
const checkJwt = jwt({
// TODO: Once @types/express-jwt is updated, remove this type mangling
secret: jwksRsa.expressJwtSecret({
jwksUri: `${config.auth.domain}.well-known/jwks.json`,
}),
}) as GetVerificationKey,
audience: config.auth.audience,
issuer: config.auth.domain,
algorithms: ['RS256'],
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 305b5c5

Please sign in to comment.