Guest User

Untitled

a guest
Mar 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. const register = async params => {
  2. const verifyParams = await verify(params);
  3. const passwordMatch = await passwordCheck(params);
  4. const user = await createUser(params);
  5. return { verifyParams, passwordMatch, user };
  6. };
  7.  
  8. register({
  9. username: 'moosch',
  10. password: 'terryfolds',
  11. confPassword: 'terryfolds',
  12. })
  13. .then(data => { // returns the object from line 5
  14. return data.user;
  15. })
  16. .catch(error => {
  17. throw new Error(error);
  18. });
Add Comment
Please, Sign In to add comment