-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathspree-ember-auth.js
More file actions
23 lines (18 loc) · 880 Bytes
/
Copy pathspree-ember-auth.js
File metadata and controls
23 lines (18 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Session from 'simple-auth/session';
import Authorizer from 'spree-ember-auth/authorizers/spree';
import Authenticator from 'spree-ember-auth/authenticators/spree';
export function initialize(registry, application) {
var container = application.__container__; //TODO: remove deprecation
application.register('simple-auth-authorizer:spree', Authorizer);
application.register('simple-auth-authenticator:spree', Authenticator);
var SpreeAuthorizer = container.lookup('simple-auth-authorizer:spree');
var SpreeAuthenticator = container.lookup('simple-auth-authenticator:spree');
var SpreeAdapter = container.lookup('adapter:-spree');
SpreeAuthenticator.set('serverTokenEndpoint', SpreeAdapter.buildURL('user')+'/token');
}
export default {
name: 'spree-ember-auth',
before: 'simple-auth',
after: 'spree-ember-core',
initialize: initialize
};