Advertisement
Guest User

Untitled

a guest
Feb 24th, 2016
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. // sign up
  2. account.signUp('joe@example.com', 'secret');
  3.  
  4. // sign in
  5. account.signIn('joe@example.com', 'secret');
  6.  
  7. // sign in via oauth
  8. account.signInWith('twitter');
  9.  
  10. // sign out
  11. account.signOut();
  12.  
  13. // change password
  14. account.changePassword('currentpassword', 'newpassword');
  15.  
  16. // change username
  17. account.changeUsername('currentpassword', 'newusername');
  18.  
  19. // reset password
  20. account.resetPassword('joe@example.com');
  21.  
  22. // destroy account and all its data
  23. account.destroy('currentpassword');
  24.  
  25. // all methods could alternatively accept a parameter hash
  26. // that would also allow for additional user info
  27. account.signUp({
  28. username: 'joe2000',
  29. password: 'secret',
  30. birthday: '1984-05-09',
  31. email: 'joe@example.com'
  32. });
  33.  
  34. // that would also allow for a general change method,
  35. // that changeUsername or changePassword would simply
  36. // be shortcuts for
  37. account.change({
  38. birthday: '1984-05-09',
  39. });
  40. account.change({
  41. username: 'joe3000',
  42. password: 'secret'
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement