ember-auth-rails 3.4.3 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,12 +10,18 @@
10
10
  jqxhr: null,
11
11
  prevRoute: null,
12
12
  signIn: function(data) {
13
- var _this = this;
13
+ var async,
14
+ _this = this;
14
15
  if (data == null) {
15
16
  data = {};
16
17
  }
18
+ async = data.async != null ? data.async : true;
19
+ if (data.async != null) {
20
+ delete data['async'];
21
+ }
17
22
  return this.ajax(this.resolveUrl(Auth.Config.get('tokenCreateUrl')), 'POST', {
18
23
  data: data,
24
+ async: async,
19
25
  success: function(json, status, jqxhr) {
20
26
  _this.set('authToken', json[Auth.Config.get('tokenKey')]);
21
27
  _this.set('currentUserId', json[Auth.Config.get('idKey')]);
@@ -34,13 +40,19 @@
34
40
  });
35
41
  },
36
42
  signOut: function(data) {
37
- var _this = this;
43
+ var async,
44
+ _this = this;
38
45
  if (data == null) {
39
46
  data = {};
40
47
  }
41
48
  data[Auth.Config.get('tokenKey')] = this.get('authToken');
49
+ async = data.async != null ? data.async : true;
50
+ if (data.async != null) {
51
+ delete data['async'];
52
+ }
42
53
  return this.ajax(this.resolveUrl(Auth.Config.get('tokenDestroyUrl')), 'DELETE', {
43
54
  data: data,
55
+ async: async,
44
56
  success: function(json, status, jqxhr) {
45
57
  _this.set('authToken', null);
46
58
  _this.set('currentUserId', null);
@@ -114,7 +126,8 @@
114
126
  signOutRedirectFallbackRoute: 'index',
115
127
  rememberMe: false,
116
128
  rememberTokenKey: null,
117
- rememberPeriod: 14
129
+ rememberPeriod: 14,
130
+ rememberAutoRecall: true
118
131
  });
119
132
 
120
133
  Auth.Route = Em.Route.extend(Em.Evented, {
@@ -180,13 +193,19 @@
180
193
  return _this.forget();
181
194
  });
182
195
  },
183
- recall: function() {
196
+ recall: function(opts) {
184
197
  var data, token;
198
+ if (opts == null) {
199
+ opts = {};
200
+ }
185
201
  if (!Auth.Config.get('rememberMe')) {
186
202
  return;
187
203
  }
188
204
  if (!Auth.get('authToken') && (token = $.cookie('ember-auth-remember-me'))) {
189
205
  data = {};
206
+ if (opts.async != null) {
207
+ data['async'] = opts.async;
208
+ }
190
209
  data[Auth.Config.get('rememberTokenKey')] = token;
191
210
  return Auth.signIn(data);
192
211
  }
@@ -213,4 +232,15 @@
213
232
  }
214
233
  });
215
234
 
235
+ Auth.Route.reopen({
236
+ redirect: function() {
237
+ if (Auth.Config.get('rememberMe') && Auth.Config.get('rememberAutoRecall')) {
238
+ Auth.Module.RememberMe.recall({
239
+ async: false
240
+ });
241
+ }
242
+ return this._super();
243
+ }
244
+ });
245
+
216
246
  }).call(this);
@@ -1,5 +1,5 @@
1
1
  module EmberAuth
2
2
  module Rails
3
- VERSION = '3.4.3'
3
+ VERSION = '3.5.0'
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module EmberAuth
2
- VERSION = '2.2.3'
2
+ VERSION = '2.3.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-auth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.3
4
+ version: 3.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-11 00:00:00.000000000 Z
12
+ date: 2013-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ember-rails