ember-auth-module-rememberable-source 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/ember-auth-module-rememberable.js +13 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da80ad1de78c42c6ce8a067c713ca063c847bff4
|
4
|
+
data.tar.gz: c5203e1462f31bd9cd7654199fdc72920ac25cbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eaf8cbfbbd87e8e936f302648107d1c7c0c8c59223a59db597e56c93241c8477dff99fbc5ed2d474e89d5172c5fa1434d635016c6e0893bb9c123050a62cb54
|
7
|
+
data.tar.gz: 9c8cc40ccb76350d67c08c8e072566be6cc614ffe8d126f69f8a34928ac61056c84d9da56b2aabb39e51b0451302653507f03fad3f760d49f1ff9e9693ece657
|
@@ -21,17 +21,25 @@ var get$ = Ember.get;
|
|
21
21
|
var set$ = Ember.set;
|
22
22
|
set$(get$(Em, 'Auth'), 'RememberableAuthModule', Ember.Object.extend({
|
23
23
|
init: function () {
|
24
|
-
|
24
|
+
get$(this, 'auth')._config('rememberable', get$(this, '_defaultConfig'));
|
25
|
+
null != get$(this, 'config') || set$(this, 'config', get$(this, 'auth')._config('rememberable'));
|
25
26
|
this.patch();
|
26
27
|
get$(this, 'auth').addHandler('signInSuccess', get$(this, 'remember').bind(this));
|
27
28
|
get$(this, 'auth').addHandler('signInError', get$(this, 'forget').bind(this));
|
28
29
|
return get$(this, 'auth').addHandler('signOutSuccess', get$(this, 'forget').bind(this));
|
29
30
|
},
|
31
|
+
_defaultConfig: {
|
32
|
+
tokenKey: null,
|
33
|
+
period: 14,
|
34
|
+
autoRecall: true,
|
35
|
+
endPoint: null
|
36
|
+
},
|
30
37
|
recall: function (opts) {
|
31
38
|
var token;
|
32
39
|
if (null == opts)
|
33
40
|
opts = {};
|
34
41
|
if (!get$(get$(this, 'auth'), 'signedIn') && (token = this.retrieveToken())) {
|
42
|
+
set$(this, 'fromRecall', true);
|
35
43
|
opts.data || (opts.data = {});
|
36
44
|
get$(opts, 'data')[get$(get$(this, 'config'), 'tokenKey')] = token;
|
37
45
|
if (null != get$(get$(this, 'config'), 'endPoint')) {
|
@@ -45,7 +53,9 @@ set$(get$(Em, 'Auth'), 'RememberableAuthModule', Ember.Object.extend({
|
|
45
53
|
},
|
46
54
|
remember: function (data) {
|
47
55
|
var token;
|
48
|
-
this
|
56
|
+
if (!get$(this, 'fromRecall'))
|
57
|
+
this.forget();
|
58
|
+
set$(this, 'fromRecall', false);
|
49
59
|
if (token = data[get$(get$(this, 'config'), 'tokenKey')])
|
50
60
|
if (!(token === this.retrieveToken())) {
|
51
61
|
return this.storeToken(token);
|
@@ -82,13 +92,4 @@ set$(get$(Em, 'Auth'), 'RememberableAuthModule', Ember.Object.extend({
|
|
82
92
|
}
|
83
93
|
});
|
84
94
|
}
|
85
|
-
}))
|
86
|
-
var get$ = Ember.get;
|
87
|
-
get$(Em, 'Auth').reopen({
|
88
|
-
rememberable: {
|
89
|
-
tokenKey: null,
|
90
|
-
period: 14,
|
91
|
-
autoRecall: true,
|
92
|
-
endPoint: null
|
93
|
-
}
|
94
|
-
});
|
95
|
+
}));
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-auth-module-rememberable-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- heartsentwined
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ember-source
|