Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- signinUser: async (root, data, { mongo: { Users } }) => {
- const user = await Users.findOne({ email: data.email.email });
- if (user === null) {
- throw new Error("Email not found !!");
- }
- if (data.email.password === user.password) {
- return { token: `token-${user.email}`, user };
- }
- },
Add Comment
Please, Sign In to add comment