[FIX] Create Custom OAuth services from environment variables (#17377)

pull/18942/head
Maarten 5 years ago committed by Diego Sampaio
parent c4a6ffdd15
commit ecf613e0e0
No known key found for this signature in database
GPG Key ID: E060152B30502562
  1. 12
      app/lib/server/startup/oAuthServicesUpdate.js

@ -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();

Loading…
Cancel
Save