(token: string, jwks: JWTVerifyGetKey)
| 145 | // and live org-membership is re-checked downstream. Signature + expiry are |
| 146 | // enforced by jose. |
| 147 | export const verifyWorkosUserManagementToken = (token: string, jwks: JWTVerifyGetKey) => |
| 148 | Effect.gen(function* () { |
| 149 | const { payload } = yield* Effect.tryPromise({ |
| 150 | try: () => jwtVerify(token, jwks, workosAccessTokenOptions), |
| 151 | catch: classifyJwtVerificationError, |
| 152 | }).pipe(withJwtVerificationSpan); |
| 153 | |
| 154 | return identityFromClaims(payload); |
| 155 | }); |
no test coverage detected