ember-auth-source 6.0.3 → 6.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/dist/ember-auth.js +10 -15
  2. metadata +3 -3
@@ -55,7 +55,7 @@ set$(get$(Em, 'Auth'), 'Request', Ember.Object.extend({
55
55
  init: function () {
56
56
  var adapter;
57
57
  if (!(null != get$(this, 'adapter'))) {
58
- adapter = get$(Em, 'String').classify(get$(get$(this, 'auth'), 'requestAdapter'));
58
+ adapter = get$(Em, 'String').capitalize(get$(Em, 'String').camelize(get$(get$(this, 'auth'), 'requestAdapter')));
59
59
  if (null != get$(get$(Em, 'Auth'), 'Request')[adapter]) {
60
60
  set$(this, 'adapter', get$(get$(Em, 'Auth'), 'Request')[adapter].create({ auth: get$(this, 'auth') }));
61
61
  } else {
@@ -222,7 +222,7 @@ set$(get$(Em, 'Auth'), 'Response', Ember.Object.extend({
222
222
  var adapter;
223
223
  null != get$(this, 'response') || set$(this, 'response', {});
224
224
  if (!(null != get$(this, 'adapter'))) {
225
- adapter = get$(Em, 'String').classify(get$(get$(this, 'auth'), 'responseAdapter'));
225
+ adapter = get$(Em, 'String').capitalize(get$(Em, 'String').camelize(get$(get$(this, 'auth'), 'responseAdapter')));
226
226
  if (null != get$(get$(Em, 'Auth'), 'Response')[adapter]) {
227
227
  set$(this, 'adapter', get$(get$(Em, 'Auth'), 'Response')[adapter].create({ auth: get$(this, 'auth') }));
228
228
  } else {
@@ -276,7 +276,7 @@ set$(get$(Em, 'Auth'), 'Strategy', Ember.Object.extend({
276
276
  init: function () {
277
277
  var adapter;
278
278
  if (!(null != get$(this, 'adapter'))) {
279
- adapter = get$(Em, 'String').classify(get$(get$(this, 'auth'), 'strategyAdapter'));
279
+ adapter = get$(Em, 'String').capitalize(get$(Em, 'String').camelize(get$(get$(this, 'auth'), 'strategyAdapter')));
280
280
  if (null != get$(get$(Em, 'Auth'), 'Strategy')[adapter]) {
281
281
  return set$(this, 'adapter', get$(get$(Em, 'Auth'), 'Strategy')[adapter].create({ auth: get$(this, 'auth') }));
282
282
  } else {
@@ -377,7 +377,7 @@ set$(get$(Em, 'Auth'), 'Session', Ember.Object.extend({
377
377
  null != get$(this, 'userId') || set$(this, 'userId', null);
378
378
  null != get$(this, 'user') || set$(this, 'user', null);
379
379
  if (!(null != get$(this, 'adapter'))) {
380
- adapter = get$(Em, 'String').classify(get$(get$(this, 'auth'), 'sessionAdapter'));
380
+ adapter = get$(Em, 'String').capitalize(get$(Em, 'String').camelize(get$(get$(this, 'auth'), 'sessionAdapter')));
381
381
  if (null != get$(get$(Em, 'Auth'), 'Session')[adapter]) {
382
382
  set$(this, 'adapter', get$(get$(Em, 'Auth'), 'Session')[adapter].create({ auth: get$(this, 'auth') }));
383
383
  } else {
@@ -394,22 +394,17 @@ set$(get$(Em, 'Auth'), 'Session', Ember.Object.extend({
394
394
  },
395
395
  syncEvent: function (name, args) {
396
396
  args = 2 <= arguments.length ? [].slice.call(arguments, 1) : [];
397
- switch (name) {
398
- case 'signInSuccess':
399
- this.findUser();
400
- }
401
397
  if (null != get$(get$(this, 'adapter'), 'syncEvent'))
402
398
  return get$(get$(this, 'adapter'), 'syncEvent').apply(get$(this, 'adapter'), arguments);
403
399
  },
404
- findUser: Ember.observer(function () {
400
+ findUser: function () {
405
401
  var model, modelKey;
406
- if (!(get$(this, 'signedIn') && get$(this, 'userId')))
407
- return;
408
- if ((modelKey = get$(get$(this, 'auth'), 'userModel')) && (model = Ember.get(modelKey)))
402
+ if (get$(this, 'userId') && (modelKey = get$(get$(this, 'auth'), 'userModel')) && (model = Ember.get(modelKey)))
409
403
  return set$(this, 'user', model.find(get$(this, 'userId')));
410
- }, 'signedIn', 'userId'),
404
+ },
411
405
  start: function () {
412
- return set$(this, 'signedIn', true);
406
+ set$(this, 'signedIn', true);
407
+ return this.findUser();
413
408
  },
414
409
  clear: function () {
415
410
  set$(this, 'signedIn', false);
@@ -589,7 +584,7 @@ set$(get$(Em, 'Auth'), 'Module', Ember.Object.extend({
589
584
  for (var i$ = 0, length$ = get$(get$(this, 'auth'), 'modules').length; i$ < length$; ++i$) {
590
585
  key = get$(get$(this, 'auth'), 'modules')[i$];
591
586
  key = get$(Em, 'String').camelize(key);
592
- module = get$(Em, 'String').classify(key);
587
+ module = get$(Em, 'String').capitalize(get$(Em, 'String').camelize(key));
593
588
  if (null != get$(get$(Em, 'Auth'), 'Module')[module]) {
594
589
  this.set('module.' + key, get$(get$(Em, 'Auth'), 'Module')[module].create({ auth: get$(this, 'auth') }));
595
590
  } else {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ember-auth-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.3
4
+ version: 6.0.4
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-05-10 00:00:00.000000000 Z
12
+ date: 2013-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ember-source
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  segments:
77
77
  - 0
78
- hash: 756698609
78
+ hash: 619222717
79
79
  required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  none: false
81
81
  requirements: