Skip to content

Instantly share code, notes, and snippets.

@sergioalvz
sergioalvz / jwks-hapi-auth-jwt2-workaround.ts
Last active April 24, 2020 12:09
A workaround to make jwks-rsa to be compliant with new hapi-auth-jwt2#v-17 API
import { hapiJwt2Key } from 'jwks-rsa';
async function validate(decoded) {
if (decoded && decoded.sub) {
return { isValid: true };
}
return { isValid: false };
}