adonisjs / auth

Official Authentication package for AdonisJS
https://docs.adonisjs.com/guides/auth/introduction
MIT License
187 stars 65 forks source link

guardFactory is not a function #242

Closed AimForNaN closed 4 months ago

AimForNaN commented 4 months ago

Package version

@adonisjs/auth@9.1.1

Describe the bug

Setting guards to middleware.auth() throws an error.

Code that triggered it:

router.get('/', '#controllers/index_controller.index').use(middleware.auth({
    guards: ['web', 'api'],
}));

Error blamed on app/middleware/auth_middleware.ts line 22.

Reproduction repo

No response

thetutlage commented 4 months ago

Please share complete reproduction. Just with one line of code, I cannot figure out the error.