Merge pull request #2726 from FreeCodeCamp/fix/email-login

This commit is contained in:
Ben McMahon
2015-08-26 23:43:12 +01:00

View File

@ -123,6 +123,14 @@ module.exports = function(User) {
});
});
User.beforeRemote('login', function(ctx, notUsed, next) {
const { body } = ctx.req;
if (body && typeof body.email === 'string') {
body.email = body.email.toLowerCase();
}
next();
});
User.afterRemote('login', function(ctx, accessToken, next) {
var res = ctx.res;
var req = ctx.req;