JKHeadley / appy

🚀 A full stack boilerplate web app
https://appyapp.io
MIT License
255 stars 65 forks source link

"auth" is not allowed when running seed script via docker #31

Open anurupr opened 4 years ago

anurupr commented 4 years ago

I haven't tested it outside of docker to confirm if it is a universal issue with the code

I'm getting this error after setting up appy via docker and then running the seed script

[1] "auth" is not allowed
ERROR    seed.js:629:9 seed —     at Object.exports.process (/backend/node_modules/hapi/node_modules/joi/lib/errors.js:201:19)
ERROR    seed.js:629:9 seed —     at internals.Object._validateWithOptions (/backend/node_modules/hapi/node_modules/joi/lib/types/any/index.js:751:31)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.validate (/backend/node_modules/hapi/node_modules/joi/lib/index.js:146:23)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.attempt (/backend/node_modules/hapi/node_modules/joi/lib/index.js:176:29)
ERROR    seed.js:629:9 seed —     at module.exports.internals.Any.root.assert (/backend/node_modules/hapi/node_modules/joi/lib/index.js:171:14)
ERROR    seed.js:629:9 seed —     at Object.exports.inject (/backend/node_modules/hapi/node_modules/shot/lib/index.js:52:17)
ERROR    seed.js:629:9 seed —     at internals.Server.inject (/backend/node_modules/hapi/lib/server.js:309:32)
ERROR    seed.js:629:9 seed —     at seed (/backend/scripts/seed.js:313:31)
ERROR    seed.js:629:9 seed —     at <anonymous>
ERROR    seed.js:629:9 seed —     at process._tickDomainCallback (internal/process/next_tick.js:229:7)

This is the block of code where the issue is happening

    injectOptions = RestHapi.testHelper.mockInjection(request)
    let result = await server.inject(injectOptions)

Specifically failing at server.inject.

If i replace the auth key with credentials and use the same value as request.credentials. the script completes. If this is only an issue with hapijs . please go ahead and close this issue

JKHeadley commented 4 years ago

Apologies, I've been swamped and haven't been able to visit issues in a while. I believe this is due to an update in rest-hapi moving to hapi v18:

https://github.com/hapijs/hapi/issues/3871#issue-377743660

See the section Migration Checklist -> server.inject() Authentication

The fix should be simple and I believe @anurupr mentioned it. I will try to push an update soon.

JKHeadley commented 4 years ago

A quick update here. The issue seems to step from rest-hapi >1.8 updating to hapi 18 while appy is still using other hapi libraries that depend on hapi 17.

A quick fix for now is to set your rest-hapi version to be explicitly v1.7

metinjakupi commented 3 years ago

bump!