Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. pool.query(
  2. `SELECT count(*) AS count
  3. FROM persons WHERE google_user_id = ?`,
  4. [googleUserId],
  5. (err, result, fields) => {
  6. if (err) throw new Error(err);
  7.  
  8. const token = generateToken({googleUserId: googleUserId});
  9.  
  10. res.status(200).json({userAuthorized: result[0].count === 1, token: token});
  11. }
  12. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement