diff --git a/services/app-api/libs/authorization.js b/services/app-api/libs/authorization.js index 0d9043ed..083a5244 100644 --- a/services/app-api/libs/authorization.js +++ b/services/app-api/libs/authorization.js @@ -1,5 +1,5 @@ import { SSMClient, GetParameterCommand } from "@aws-sdk/client-ssm"; -import jwt_decode from "jwt-decode"; +import { jwtDecode } from "jwt-decode"; import { CognitoJwtVerifier } from "aws-jwt-verify"; import * as logger from "./debug-lib.js"; import { SimpleJwksCache } from "aws-jwt-verify/jwk"; @@ -9,10 +9,10 @@ export async function getUserDetailsFromEvent(event) { await verifyEventSignature(event); const apiKey = event?.headers?.["x-api-key"]; - // TODO, it seems that jwt_decode and verifier.verify may return the same object? - // Maybe we can remove the jwt_decode dependency. + // TODO, it seems that jwtDecode and verifier.verify may return the same object? + // Maybe we can remove the jwtDecode dependency. - const token = jwt_decode(apiKey); + const token = jwtDecode(apiKey); const role = mapMembershipToRole(token["custom:ismemberof"]); return {