fix email sign should not require username
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { Observable } from 'rx';
|
||||
import uuid from 'node-uuid';
|
||||
import moment from 'moment';
|
||||
import debugFactory from 'debug';
|
||||
|
||||
@ -62,6 +63,11 @@ module.exports = function(User) {
|
||||
ctx.res.redirect('/email-signin');
|
||||
});
|
||||
|
||||
User.beforeRemote('create', function({ req }, notUsed, next) {
|
||||
req.body.username = 'fcc' + uuid.v4().slice(0, 8);
|
||||
next();
|
||||
});
|
||||
|
||||
User.afterRemote('login', function(ctx, user, next) {
|
||||
var res = ctx.res;
|
||||
var req = ctx.req;
|
||||
|
Reference in New Issue
Block a user