Skip to content

Commit

Permalink
Update jose 3.20.3 > 4.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnito committed May 17, 2022
1 parent 298bcab commit 6661e10
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"full-icu": "^1.4.0",
"helmet": "^4.6.0",
"intl-pluralrules": "^1.3.1",
"jose": "3.20.3",
"jose": "4.8.1",
"lodash": "^4.17.21",
"mapbox-gl-multitouch": "^1.0.3",
"moment": "^2.29.3",
Expand Down
7 changes: 3 additions & 4 deletions server/api-util/idToken.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const crypto = require('crypto');
const { default: fromKeyLike } = require('jose/jwk/from_key_like');
const { default: SignJWT } = require('jose/jwt/sign');
const jose = require('jose');

const radix = 10;
const PORT = parseInt(process.env.REACT_APP_DEV_API_SERVER_PORT, radix);
Expand Down Expand Up @@ -50,7 +49,7 @@ exports.createIdToken = (idpClientId, user, options) => {

const { userId, firstName, lastName, email, emailVerified } = user;

const jwt = new SignJWT({
const jwt = new jose.SignJWT({
given_name: firstName,
family_name: lastName,
email: email,
Expand Down Expand Up @@ -89,7 +88,7 @@ exports.openIdConfiguration = (req, res) => {
*/
exports.jwksUri = keys => (req, res) => {
const jwkKeys = keys.map(key => {
return fromKeyLike(crypto.createPublicKey(key.rsaPublicKey)).then(res => {
return jose.exportJWK(crypto.createPublicKey(key.rsaPublicKey)).then(res => {
return { alg: key.alg, kid: key.keyId, ...res };
});
});
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8975,10 +8975,10 @@ [email protected]:
import-local "^3.0.2"
jest-cli "^26.6.0"

jose@3.20.3:
version "3.20.3"
resolved "https://registry.yarnpkg.com/jose/-/jose-3.20.3.tgz#a074f684b07e49b35c075d97561883e3c637abf2"
integrity sha512-Z4a5Nl4pmGivdSgaq+a5EbNjrvSO4vtBTmVy5C3HNxWfJ92aG8DTNZrQywowxyOlSqdX/BmCPAy/ieElXDM3pw==
jose@4.8.1:
version "4.8.1"
resolved "https://registry.yarnpkg.com/jose/-/jose-4.8.1.tgz#dc7c2660b115ba29b44880e588c5ac313c158247"
integrity sha512-+/hpTbRcCw9YC0TOfN1W47pej4a9lRmltdOVdRLz5FP5UvUq3CenhXjQK7u/8NdMIIShMXYAh9VLPhc7TjhvFw==

js-cookie@^2.1.3:
version "2.2.1"
Expand Down

0 comments on commit 6661e10

Please sign in to comment.