Error: Unknown authentication strategy "local" on Passport authentication middleware

System Information
  • Strapi Version: 3.5.4
  • Operating System: Ubuntu 20.04
  • Database: MySQL
  • Node Version: 10.19.0
  • NPM Version: 6.14.4
  • Yarn Version: 1.22.10

I was testing with middlewares when after a while I tried to log into casue I got log out from my Strapi Admin panel and after trying to access with the same credentials than always I got the following error:

Error: Unknown authentication strategy "local"
    at attempt (/var/www/test/node_modules/passport/lib/middleware/authenticate.js:190:39)
    at authenticate (/var/www/test/node_modules/passport/lib/middleware/authenticate.js:367:7)
    at /var/www/test/node_modules/koa-passport/lib/framework/koa.js:194:7
    at new Promise (<anonymous>)
    at /var/www/test/node_modules/koa-passport/lib/framework/koa.js:193:12
    at Promise (/var/www/test/node_modules/koa-passport/lib/framework/koa.js:143:7)
    at new Promise (<anonymous>)
    at passportAuthenticate (/var/www/test/node_modules/koa-passport/lib/framework/koa.js:107:15)
    at module.exports.login.compose (/var/www/test/node_modules/strapi-admin/controllers/authentication.js:36:9)
    at dispatch (/var/www/test/node_modules/koa-compose/index.js:42:32)
    at Object.login (/var/www/test/node_modules/koa-compose/index.js:34:12)
    at dispatch (/var/www/test/node_modules/koa-router/node_modules/koa-compose/index.js:44:32)
    at next (/var/www/test/node_modules/koa-router/node_modules/koa-compose/index.js:45:18)
    at dispatch (/var/www/test/node_modules/koa-compose/index.js:42:32)
    at policies.push (/var/www/test/node_modules/strapi/lib/middlewares/router/utils/routerChecker.js:79:28)
    at dispatch (/var/www/test/node_modules/koa-compose/index.js:42:32)

This error happens every time I press the log in button on the Strapi admin panel log in window.

And it doesnt even checks if the data I introduce is correct or not, I think it should be something before that check.

Thanks in advance



Do not use the keyword “Auth” on middlewares folder and be sure that you dont have a problem on middleware config file.

Used to get errors telling you exactly what is bad, if you tell this case you won’t get it.

I hope this is useful for anyone.