dwyl / hapi-postgres-connection

:zap: Creates a PostgreSQL Connection (Pool) available anywhere in your Hapi App
GNU General Public License v2.0
40 stars 13 forks source link

The pg.client is not available in JWT validate function #7

Closed rug1 closed 8 years ago

rug1 commented 8 years ago

at the moment the plugin only makes the postgres client available after authorization... https://github.com/dwyl/hapi-postgres-connection/blob/218aa68f7a75ab8a7dad73125663da00a309d3bb/index.js#L12

when we change 'onPreHandler' to 'onPreAuth' the postgres become available in the JWT validateFunction. can we submit a patch?

nelsonic commented 8 years ago

Makes sense. please PR. :+1: