We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am facing issues registering hapi-auth-jwt2 plugin in Hapi Server. We are upgrading from v16 to latest. Here is my register code:
const server = new Hapi.Server({ host: '0.0.0.0', port: process.env.PORT }) const start = async function () { await server.register({ plugin: require('hapi-auth-jwt2'), options: { name: 'hapi-auth-jwt-2' } }); server.auth.strategy('jwt', 'jwt', { key: Buffer.from(jwtSecret, 'base64'), validate: validate, verifyOptions: { algorithms: [ 'HS256' ] } }) server.auth.default('jwt') server.route([//routes removed for clarity]) }; start(); module.exports = () => { return server; }
In another file we are importing and trying to start server
var server = require('./server')() server.start().then(() => {})
But when I run I am getting "UnhandledPromiseRejectionWarning: Error: Cannot start server before plugins finished registration"
How to register hapi-auth-jwt2 successfully in the latest hapi version.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am facing issues registering hapi-auth-jwt2 plugin in Hapi Server. We are upgrading from v16 to latest. Here is my register code:
In another file we are importing and trying to start server
But when I run I am getting "UnhandledPromiseRejectionWarning: Error: Cannot start server before plugins finished registration"
How to register hapi-auth-jwt2 successfully in the latest hapi version.
The text was updated successfully, but these errors were encountered: