Created
June 28, 2018 14:20
-
-
Save SilencerWeb/c27340428ca63793500bec716c5aaefe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
signup: async(_, args, context, info) => { | |
const password = await bcrypt.hash(args.password, 10); | |
const user = await context.prisma.mutation.createUser({ | |
data: { | |
email: args.email.toLowerCase(), | |
password: password, | |
nickname: args.nickname.toLowerCase(), | |
name: args.name, | |
}, | |
}); | |
return { | |
token: jwt.sign({ userId: user.id }, process.env.APP_SECRET), | |
user, | |
}; | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment