Guest User

Untitled

a guest
Nov 25th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. signinUser: async (root, data, { mongo: { Users } }) => {
  2. const user = await Users.findOne({ email: data.email.email });
  3. if (user === null) {
  4. throw new Error("Email not found !!");
  5. }
  6.  
  7. if (data.email.password === user.password) {
  8. return { token: `token-${user.email}`, user };
  9. }
  10. },
Add Comment
Please, Sign In to add comment