| 3 | import crypto from 'crypto'; |
| 4 | |
| 5 | export const getUserByEmail = async email => { |
| 6 | const users = await r.table('users').getAll(email, {index: 'email'}).limit(1).run(); |
| 7 | return users[0]; |
| 8 | }; |
| 9 | |
| 10 | export const signJwt = ({id}) => { |
| 11 | const secret = process.env.JWT_SECRET || 'topsecret'; |