app.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. if (Meteor.isClient) {
  2. Template.register.events({
  3. "submit form": function(e){
  4. e.preventDefault();
  5. var username = e.target.registerUsername.value;
  6. var email = e.target.registerEmail.value;
  7. var password = e.target.registerPassword.value;
  8. Accounts.createUser({
  9. username: username,
  10. email: email,
  11. password: password
  12. });
  13. },
  14. "click #facebook-login": function(){
  15. Meteor.loginWithFacebook()
  16. },
  17. "click #github-login": function(){
  18. Meteor.loginWithGithub()
  19. },
  20. "click #login": function(){
  21. }
  22. });
  23. Template.login.events({
  24. "submit form": function(e){
  25. e.preventDefault();
  26. var username = e.target.loginUsername.value;
  27. var password = e.target.loginPassword.value;
  28. Meteor.loginWithPassword(username, password);
  29. },
  30. "click #facebook-login": function(){
  31. Meteor.loginWithFacebook()
  32. },
  33. "click #github-login": function(){
  34. Meteor.loginWithGithub()
  35. },
  36. "click #register": function(){
  37. }
  38. });
  39. Template.dashboard.events({
  40. "click .logout": function(e){
  41. e.preventDefault();
  42. Meteor.logout();
  43. }
  44. })
  45. }
  46. if (Meteor.isServer) {
  47. ServiceConfiguration.configurations.remove({
  48. service: "facebook"
  49. });
  50. ServiceConfiguration.configurations.insert({
  51. service: "facebook",
  52. appId: "1496014310695890",
  53. secret: "9a039f254a08a1488c08bb0737dbd2a6"
  54. });
  55. ServiceConfiguration.configurations.remove({
  56. service: "github"
  57. });
  58. ServiceConfiguration.configurations.insert({
  59. service: "github",
  60. clientId: "dcecd720f47c0e4001f7",
  61. secret: "375939d001ef1a0ca67c11dbf8fb9aeaa551e01b"
  62. });
  63. }