ember-auth-rails 3.5.0 → 3.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -17,6 +17,10 @@ Or install it yourself as:
17
17
 
18
18
  $ gem install ember-auth-rails
19
19
 
20
+ Add `ember-auth` to sprockets. `application.js`:
21
+
22
+ //= require ember-auth
23
+
20
24
  ## Usage
21
25
 
22
26
  See [README](https://github.com/heartsentwined/ember-auth) at the main
@@ -7,6 +7,7 @@
7
7
  window.Auth = evented.create({
8
8
  authToken: null,
9
9
  currentUserId: null,
10
+ currentUser: null,
10
11
  jqxhr: null,
11
12
  prevRoute: null,
12
13
  signIn: function(data) {
@@ -23,8 +24,12 @@
23
24
  data: data,
24
25
  async: async,
25
26
  success: function(json, status, jqxhr) {
27
+ var model;
26
28
  _this.set('authToken', json[Auth.Config.get('tokenKey')]);
27
29
  _this.set('currentUserId', json[Auth.Config.get('idKey')]);
30
+ if (model = Auth.Config.get('userModel')) {
31
+ _this.set('currentUser', model.find(_this.get('currentUserId')));
32
+ }
28
33
  _this.set('jqxhr', jqxhr);
29
34
  return _this.trigger('signInSuccess');
30
35
  },
@@ -116,6 +121,7 @@
116
121
  tokenDestroyUrl: null,
117
122
  tokenKey: null,
118
123
  idKey: null,
124
+ userModel: null,
119
125
  baseUrl: null,
120
126
  signInRoute: null,
121
127
  signOutRoute: null,
@@ -1,5 +1,5 @@
1
1
  module EmberAuth
2
2
  module Rails
3
- VERSION = '3.5.0'
3
+ VERSION = '3.6.0'
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module EmberAuth
2
- VERSION = '2.3.0'
2
+ VERSION = '2.4.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.5.0
4
+ version: 3.6.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-29 00:00:00.000000000 Z
12
+ date: 2013-03-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ember-rails