Skip to content

Commit

Permalink
Merge pull request #39 from stormpath/web-social
Browse files Browse the repository at this point in the history
Implement stormpath.web.social config options
  • Loading branch information
typerandom committed Feb 24, 2016
2 parents 5be48bd + e50e5ab commit 02985fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/strategy/EnrichIntegrationFromRemoteConfigStrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ EnrichIntegrationFromRemoteConfigStrategy.prototype._enrichWithSocialProviders =
return callback(err);
}

if (!config.socialProviders) {
config.socialProviders = {};
if (!config.web.social) {
config.web.social = {};
}

mappings.each(function (mapping, next) {
Expand All @@ -87,14 +87,14 @@ EnrichIntegrationFromRemoteConfigStrategy.prototype._enrichWithSocialProviders =
delete remoteProvider.createdAt;
delete remoteProvider.updatedAt;

var localProvider = config.socialProviders[providerId];
var localProvider = config.web.social[providerId];

if (!localProvider) {
localProvider = config.socialProviders[providerId] = {};
localProvider = config.web.social[providerId] = {};
}

if (!localProvider.callbackUri) {
localProvider.callbackUri = '/callbacks/' + remoteProvider.providerId;
if (!localProvider.uri) {
localProvider.uri = '/callbacks/' + remoteProvider.providerId;
}

extend(remoteProvider, { enabled: true });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ describe('EnrichIntegrationFromRemoteConfigStrategy', function () {
});
});

it('should set the socialProviders property on the configuration', function (done) {
it('should set the web.social property on the configuration', function (done) {
var mockOAuthPolicy = {};
var mockAccountStoreMappings = new Collection({ size: 1 });
var mockApplication = makeMockApplication(mockOAuthPolicy, mockAccountStoreMappings);
var mockConfig = makeMockConfig(mockApplication);

testStrategy.process(mockConfig, function (err, result) {
assert.isNull(err);
assert.isDefined(result.socialProviders);
assert.isDefined(result.web.social);
done();
});
});
Expand Down

0 comments on commit 02985fc

Please sign in to comment.