added _ as accepted character in oauth services. Changed github-enterprise name to github_enterprise

pull/1005/head
Aaron Ogle 11 years ago
parent 82c46455b6
commit 00a829408d
  1. 3
      packages/rocketchat-github-enterprise/common.coffee
  2. 8
      packages/rocketchat-lib/settings/server/updateServices.coffee

@ -1,11 +1,12 @@
config =
serverURL: ''
identityPath: '/api/v3/user'
authorizePath: '/login/oauth/authorize'
addAutopublishFields:
forLoggedInUser: ['services.github-enterprise']
forOtherUsers: ['services.github-enterprise.username']
GitHubEnterprise = new CustomOAuth 'github-enterprise', config
GitHubEnterprise = new CustomOAuth 'github_enterprise', config
if Meteor.isServer
Meteor.startup ->

@ -3,8 +3,8 @@ updateServices = ->
Meteor.clearTimeout timer if timer?
timer = Meteor.setTimeout ->
services = RocketChat.models.Settings.find({_id: /^(Accounts_OAuth_|Accounts_OAuth_Custom_)[a-z]+$/i}).fetch()
services = RocketChat.models.Settings.find({_id: /^(Accounts_OAuth_|Accounts_OAuth_Custom_)[a-z_-]+$/i}).fetch()
console.log services
for service in services
console.log "Updating login service #{service._id}".blue
@ -21,6 +21,8 @@ updateServices = ->
clientId: RocketChat.models.Settings.findOneById("#{service._id}_id")?.value
secret: RocketChat.models.Settings.findOneById("#{service._id}_secret")?.value
console.log serviceName
if /Accounts_OAuth_Custom_/.test service._id
data.custom = true
data.serverURL = RocketChat.models.Settings.findOneById("#{service._id}_url")?.value
@ -43,7 +45,7 @@ updateServices = ->
if serviceName is 'Twitter'
data.consumerKey = data.clientId
delete data.clientId
console.log data
ServiceConfiguration.configurations.upsert {service: serviceName.toLowerCase()}, $set: data
else
ServiceConfiguration.configurations.remove {service: serviceName.toLowerCase()}

Loading…
Cancel
Save