hapijs / crumb

CSRF crumb generation and validation for hapi
Other
171 stars 50 forks source link

Getting plugin.register.regiter cannot read property of undefined #110

Closed Pasupathi-Rajamanickam closed 6 years ago

Pasupathi-Rajamanickam commented 6 years ago

HAPI version: ^16.6.2 Crumb version: 6.0.3

Server code:


const plugin= [
require('inert'),
{ 
  plugin: require('crumb'),
  options: {
    restful: true
  }
}
]

server.register(plugins, (err) => {

});

if (plugin.register.register) { // Required plugin ^TypeError: Cannot read property 'register' of undefined

jonathansamines commented 6 years ago

@popkutty Sorry for the late response, could you put together a reproduction of this issue?

Marsup commented 6 years ago

You likely used hapi@17's documentation. It should be register: require('crumb') in your snippet.

lock[bot] commented 4 years ago

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.