koa-js 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 763b3d4d0f0e1bdab2c56d0044308e3ef0979b23
4
- data.tar.gz: 89f003532854ca317d3e215a1015529c1c364b65
3
+ metadata.gz: 04f166d07e0353e61dd726de2645d1e2be88a69c
4
+ data.tar.gz: babcf9ecc4f9453945771b142d7a9c7f1407a4e5
5
5
  SHA512:
6
- metadata.gz: 3301d702be6f8224b3836c4c8dcb51dffb08c95ac66abba164ff30658306348db1668f288ea8e6b9b10eabdcca416157604aba1395583cb2dfabca72c92df0a7
7
- data.tar.gz: 00791e3a904eb15f2822799d66b7f2382fb849b6cf502a51b7b9ff416056422eb04e86499d43c6e08959e11a1398e1eeeed25a46bc5254f2079047ef2955c2b4
6
+ metadata.gz: fa850949acc195b182e90a2be7199197255c8f9e3e3d94ffd3054d7cd6251729bafd370cecc9d248a622862e58ddf288965124578f17bd0d8529b6e6d9717132
7
+ data.tar.gz: 385f77815758d96d8bad6c00e10a9c85baab1a9c1fd20739cd28175e66423ebcfaaf8148456afdea4b9bb8b9c433a4a828e158dd5f10d022673934994ed4927e
@@ -1,6 +1,7 @@
1
1
  var KOAUser = KOAModel.extend({
2
2
  klass: {
3
3
  callbacks: [],
4
+ use_signature: true,
4
5
  getting_user: false,
5
6
  map: {
6
7
  firstName: "first_name",
@@ -76,7 +77,7 @@ var KOAUser = KOAModel.extend({
76
77
  if(callback) return callback(err);
77
78
  return;
78
79
  }
79
- _this.id = user.id;
80
+ _this.synthesize(user);
80
81
  if(callback) callback(null, _this);
81
82
  });
82
83
  },
@@ -97,7 +98,7 @@ var KOAUser = KOAModel.extend({
97
98
 
98
99
  login: function(cb) {
99
100
  var _this = this;
100
- if(location.href.match(/https/i)) {
101
+ if(location.href.match(/https/i) && this.constructor.use_signature) {
101
102
  cards.kik.sign("login", function(signedData, username, host) {
102
103
  if(!signedData) {
103
104
  cb("Failed to sign data");
@@ -107,8 +108,7 @@ var KOAUser = KOAModel.extend({
107
108
  if(err) {
108
109
  return cb(err);
109
110
  }
110
- _this.id = user.id;
111
- _this.token = user.token;
111
+ _this.synthesize(user);
112
112
  cb(null, _this);
113
113
  });
114
114
  });
@@ -117,8 +117,7 @@ var KOAUser = KOAModel.extend({
117
117
  if(err) {
118
118
  return cb(err);
119
119
  }
120
- _this.id = user.id;
121
- _this.token = user.token;
120
+ _this.synthesize(user);
122
121
  cb(null, _this);
123
122
  });
124
123
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koa-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Rykwalder