summaryrefslogtreecommitdiff
path: root/client/button.js
diff options
context:
space:
mode:
authorYuval Adam <yuval@y3xz.com>2015-06-09 18:53:48 +0300
committerYuval Adam <yuval@y3xz.com>2015-06-09 18:53:48 +0300
commit58b4bc50d64ea8b664a2f023eb5889c640ec9a0f (patch)
tree0da99fe5743fa3ddae1a921b8425caedcd860cc3 /client/button.js
parentd0d37fb74d1509934dea97eff3ed2f3c87098286 (diff)
Login, logout and simple routing
Diffstat (limited to 'client/button.js')
-rw-r--r--client/button.js25
1 files changed, 16 insertions, 9 deletions
diff --git a/client/button.js b/client/button.js
index 8dc64a5..bc3828b 100644
--- a/client/button.js
+++ b/client/button.js
@@ -1,13 +1,20 @@
-Session.setDefault('counter', 0);
+Template.layout.events({
+ 'click .logout': function (event) {
+ Meteor.logout();
+ Router.go('login');
+ }
+})
-Template.hello.helpers({
- counter: function () {
- return Session.get('counter');
+Template.login.events({
+ 'click .login-instagram': function (event) {
+ Meteor.loginWithInstagram({}, function (err) {
+ if (err)
+ Session.set('errorMessage', err.reason || 'Unknown error');
+ });
+ return false;
}
});
-Template.hello.events({
- 'click button': function () {
- Session.set('counter', Session.get('counter') + 1);
- }
-}); \ No newline at end of file
+Accounts.onLogin(function() {
+ Router.go('one');
+});