add fetch() to create()
parent
7774197a7e
commit
0cdca62c36
|
@ -111,7 +111,7 @@ function PassportHelper () {
|
|||
|
||||
if (!req.user) {
|
||||
if (!passport) { // new user signing up, create a new user
|
||||
user = await User.create(userAttrs)
|
||||
user = await User.create(userAttrs).fetch()
|
||||
await Passport.create({
|
||||
...q,
|
||||
user: user.id
|
||||
|
|
|
@ -43,9 +43,10 @@ module.exports.protocols = {
|
|||
try {
|
||||
const token = generateToken()
|
||||
const password = user.password
|
||||
if (!password.length) throw new Error('password cannot be blank')
|
||||
delete user.password
|
||||
|
||||
const newUser = User.create(user)
|
||||
const newUser = await User.create(user).fetch()
|
||||
try {
|
||||
await Passport.create({
|
||||
protocol: 'local',
|
||||
|
|
Loading…
Reference in New Issue