lower email when login using local provider

This commit is contained in:
Pierre Noël 2021-09-27 16:40:04 +02:00
parent 412a834f98
commit 6ba4ce561f

View File

@ -1,5 +1,6 @@
'use strict';
const { toLower } = require('lodash/fp');
const { Strategy: LocalStrategy } = require('passport-local');
const createLocalStrategy = strapi => {
@ -11,7 +12,7 @@ const createLocalStrategy = strapi => {
},
(email, password, done) => {
return strapi.admin.services.auth
.checkCredentials({ email, password })
.checkCredentials({ email: toLower(email), password })
.then(([error, user, message]) => done(error, user, message))
.catch(error => done(error));
}