import { Callback , Context , CustomAuthorizerEvent , Handler } from 'aws-lambda' ; import { decodeToken } from '../../common/src/auth/authenticator' ; export const auth = ( event , context , callback ) => { console . log ( event ) ; return decodeToken ( event . authorizationToken , event . methodArn ) . then ( ( { response , error } ) => { if ( error ) { callback && callback ( error ) ; } else { callback && callback ( null , response ) ; } } ) ; } ;