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 };
}
@sergioalvz
sergioalvz / new_hg_gem.sh
Last active August 29, 2015 14:06 — forked from dgsuarez/new_hg_gem.sh
Uses Mercurial instead of Git in a gem generated by "bundle gem" but removes the spec, test and features files from the *.gemspec
#! /bin/sh
set -e
bundle gem $1
cd $1
rm -rf .git
mv .gitignore .hgignore