mirror of
https://github.com/strapi/strapi.git
synced 2025-11-13 16:52:18 +00:00
lower email when login using local provider
This commit is contained in:
parent
412a834f98
commit
6ba4ce561f
@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const { toLower } = require('lodash/fp');
|
||||||
const { Strategy: LocalStrategy } = require('passport-local');
|
const { Strategy: LocalStrategy } = require('passport-local');
|
||||||
|
|
||||||
const createLocalStrategy = strapi => {
|
const createLocalStrategy = strapi => {
|
||||||
@ -11,7 +12,7 @@ const createLocalStrategy = strapi => {
|
|||||||
},
|
},
|
||||||
(email, password, done) => {
|
(email, password, done) => {
|
||||||
return strapi.admin.services.auth
|
return strapi.admin.services.auth
|
||||||
.checkCredentials({ email, password })
|
.checkCredentials({ email: toLower(email), password })
|
||||||
.then(([error, user, message]) => done(error, user, message))
|
.then(([error, user, message]) => done(error, user, message))
|
||||||
.catch(error => done(error));
|
.catch(error => done(error));
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user