ember-auth-rails 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,7 @@
11
11
  if (data == null) {
12
12
  data = {};
13
13
  }
14
- return this.ajax(Auth.Config.get('tokenCreateUrl'), 'POST', {
14
+ return this.ajax(this.resolveUrl(Auth.Config.get('tokenCreateUrl')), 'POST', {
15
15
  data: data,
16
16
  success: function(json) {
17
17
  _this.set('authToken', json[Auth.Config.get('tokenKey')]);
@@ -31,7 +31,7 @@
31
31
  data = {};
32
32
  }
33
33
  data[Auth.Config.get('tokenKey')] = this.get('authToken');
34
- return this.ajax(Auth.Config.get('tokenDestroyUrl'), 'DELETE', {
34
+ return this.ajax(this.resolveUrl(Auth.Config.get('tokenDestroyUrl')), 'DELETE', {
35
35
  data: data,
36
36
  success: function(json) {
37
37
  _this.set('authToken', null);
@@ -45,6 +45,17 @@
45
45
  }
46
46
  });
47
47
  },
48
+ resolveUrl: function(path) {
49
+ var base;
50
+ base = Auth.Config.get('baseUrl');
51
+ if (base && base[base.length - 1] === '/') {
52
+ base = base.substr(0, base.length - 1);
53
+ }
54
+ if (path[0] === '/') {
55
+ path = path.substr(1, path.length);
56
+ }
57
+ return [base, path].join('/');
58
+ },
48
59
  resolveRedirectRoute: function(type) {
49
60
  var fallback, isSmart, sameRoute, typeClassCase;
50
61
  if (type !== 'signIn' && type !== 'signOut') {
@@ -80,6 +91,7 @@
80
91
  tokenDestroyUrl: null,
81
92
  tokenKey: null,
82
93
  idKey: null,
94
+ baseUrl: null,
83
95
  signInRoute: null,
84
96
  signOutRoute: null,
85
97
  authRedirect: false,
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  EOS
16
16
  gem.homepage = 'https://github.com/heartsentwined/ember-auth-rails'
17
17
 
18
- gem.add_dependency 'ember-rails', ['~> 0.9']
18
+ gem.add_dependency 'ember-rails', ['~> 0.10']
19
19
 
20
20
  gem.files = `git ls-files`.split($/)
21
21
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -1,5 +1,5 @@
1
1
  module EmberAuth
2
2
  module Rails
3
- VERSION = '3.0.0'
3
+ VERSION = '3.1.0'
4
4
  end
5
5
  end
@@ -1,3 +1,3 @@
1
1
  module EmberAuth
2
- VERSION = '1.0.2'
2
+ VERSION = '1.1.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.0.0
4
+ version: 3.1.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-02-16 00:00:00.000000000 Z
12
+ date: 2013-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ember-rails
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '0.9'
21
+ version: '0.10'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '0.9'
29
+ version: '0.10'
30
30
  description: ! " Ember-auth provides token authentication support to ember.js.\n
31
31
  \ It is expected to work out of the box with rails + devise.\n"
32
32
  email: