Skip to content

Commit

Permalink
[FIX] Create Custom OAuth services from environment variables (#17377)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtndwrd committed Sep 8, 2020
1 parent e30af61 commit 266f5ad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/lib/server/startup/oAuthServicesUpdate.js
Expand Up @@ -132,3 +132,15 @@ settings.get(/^Accounts_OAuth_Custom-[a-z0-9_]+/, function(key, value) {
return OAuthServicesRemove(key);// eslint-disable-line new-cap
}
});

function customOAuthServicesInit() {
// Add settings for custom OAuth providers to the settings so they get
// automatically added when they are defined in ENV variables
Object.keys(process.env).forEach((key) => {
if (/Accounts_OAuth_Custom-[a-zA-Z0-9_-]+$/.test(key)) {
settings.add(key, process.env[key]);
}
});
}

customOAuthServicesInit();

0 comments on commit 266f5ad

Please sign in to comment.