-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
150 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"preset": "ember-suave", | ||
"requireCommentsToIncludeAccess": false | ||
"requireCommentsToIncludeAccess": false, | ||
"disallowConstOutsideModuleScope": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
bower_components/ | ||
tests/ | ||
tmp/ | ||
dist/ | ||
|
||
/bower_components | ||
/config/ember-try.js | ||
/dist | ||
/tests | ||
/tmp | ||
**/.gitkeep | ||
.bowerrc | ||
.editorconfig | ||
.ember-cli | ||
.gitignore | ||
.jshintrc | ||
.watchmanconfig | ||
.travis.yml | ||
.npmignore | ||
**/.gitkeep | ||
bower.json | ||
ember-cli-build.js | ||
Brocfile.js | ||
testem.json | ||
node-tests | ||
node-tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
{ | ||
"name": "ember-simple-auth", | ||
"dependencies": { | ||
"bootstrap": "~3.3.5", | ||
"ember": "~2.3.0", | ||
"bootstrap": "~3.3.6", | ||
"ember": "~2.4.1", | ||
"ember-cli-shims": "0.1.0", | ||
"ember-cli-test-loader": "0.2.1", | ||
"ember-load-initializers": "0.1.7", | ||
"ember-cli-test-loader": "0.2.2", | ||
"ember-mocha": "~0.8.7", | ||
"ember-resolver": "~0.1.20", | ||
"jquery": "1.11.3", | ||
"loader.js": "ember-cli/loader.js#3.4.0", | ||
"sinonjs": "~1.17.1", | ||
"base64": "~0.3.0", | ||
"pretender": "^0.10.1" | ||
}, | ||
"resolutions": { | ||
"ember": "~2.2.0" | ||
"pretender": "^0.12.0" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/*jshint node:true*/ | ||
'use strict'; | ||
|
||
module.exports = function(/* environment, appConfig */) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "my-addon", | ||
"version": "0.0.0", | ||
"description": "Addon fixture package for ember-cli-blueprint-test-helpers", | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
"devDependencies": { | ||
"ember-cli": "*", | ||
"ember-simple-auth": "*" | ||
}, | ||
"keywords": [ | ||
"ember-addon" | ||
], | ||
"dependencies": { | ||
"ember-cli-htmlbars": "*", | ||
"ember-cli-babel": "*" | ||
}, | ||
"ember-addon": { | ||
"configPath": "tests/dummy/config" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "my-app", | ||
"version": "0.0.0", | ||
"description": "App fixture package for ember-cli-blueprint-test-helpers", | ||
"private": true, | ||
"engines": { | ||
"node": ">= 0.10.0" | ||
}, | ||
"devDependencies": { | ||
"ember-cli": "*", | ||
"ember-simple-auth": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
import Ember from 'ember'; | ||
import Torii from 'ember-simple-auth/authenticators/torii'; | ||
import raw from 'ic-ajax'; | ||
|
||
const { RSVP } = Ember; | ||
const { service } = Ember.inject; | ||
const { inject: { service } } = Ember; | ||
|
||
export default Torii.extend({ | ||
torii: service('torii'), | ||
torii: service(), | ||
ajax: service(), | ||
|
||
authenticate() { | ||
return new RSVP.Promise((resolve, reject) => { | ||
this._super(...arguments).then((data) => { | ||
raw({ | ||
url: '/token', | ||
type: 'POST', | ||
dataType: 'json', | ||
data: { 'grant_type': 'facebook_auth_code', 'auth_code': data.authorizationCode } | ||
}).then((response) => { | ||
resolve({ | ||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | ||
access_token: response.access_token, | ||
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers | ||
provider: data.provider | ||
}); | ||
}, reject); | ||
}, reject); | ||
const ajax = this.get('ajax'); | ||
|
||
return this._super(...arguments).then((data) => { | ||
return ajax.request('/token', { | ||
type: 'POST', | ||
dataType: 'json', | ||
data: { 'grant_type': 'facebook_auth_code', 'auth_code': data.authorizationCode } | ||
}).then((response) => { | ||
return { | ||
// jscs:disable requireCamelCaseOrUpperCaseIdentifiers | ||
access_token: response.access_token, | ||
// jscs:enable requireCamelCaseOrUpperCaseIdentifiers | ||
provider: data.provider | ||
}; | ||
}); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Resolver from 'ember-resolver'; | ||
|
||
export default Resolver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { module } from 'qunit'; | ||
import startApp from '../helpers/start-app'; | ||
import destroyApp from '../helpers/destroy-app'; | ||
|
||
export default function(name, options = {}) { | ||
module(name, { | ||
beforeEach() { | ||
this.application = startApp(); | ||
|
||
if (options.beforeEach) { | ||
// jscs:disable requireSpread | ||
options.beforeEach.apply(this, arguments); | ||
// jscs:enable requireSpread | ||
} | ||
}, | ||
|
||
afterEach() { | ||
if (options.afterEach) { | ||
// jscs:disable requireSpread | ||
options.afterEach.apply(this, arguments); | ||
// jscs:enable requireSpread | ||
} | ||
|
||
destroyApp(this.application); | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters