/**
 * Builds and configure a Passport strategy to authenticate webhook calls.
 */ import * as passport from "passport" ; import { Strategy } from "passport-auth-token" ; const urlTokenStrategy = ( preSharedKey ) : passport . Strategy => new Strategy ( ( token , done ) => { if ( typeof token === "string" && token === preSharedKey ) { return done ( undefined , { } ) ; } return done ( undefined , false ) ; } ) ; export default urlTokenStrategy ;