oAuth -> OAuth

pull/2482/head
Gabriel Engel 10 years ago
parent 26ea3ffec3
commit 0ccaa6df34
  1. 4
      HISTORY.md
  2. 2
      packages/rocketchat-custom-oauth/custom_oauth_server.coffee
  3. 2
      packages/rocketchat-github-enterprise/startup.coffee
  4. 2
      packages/rocketchat-gitlab/startup.coffee
  5. 10
      packages/rocketchat-lib/server/startup/oAuthServicesUpdate.coffee
  6. 2
      packages/rocketchat-lib/server/startup/settings.coffee
  7. 13
      packages/rocketchat-wordpress/startup.coffee
  8. 2
      server/configuration/accounts_meld.coffee

@ -200,7 +200,7 @@
- Enable editing via admin / users
- Log error when trigger url returns 500
- Bind starttls correctly for LDAP
- Custom oAuth supporting json or plain content_types responses of the identity
- Custom OAuth supporting json or plain content_types responses of the identity
- Allow pass room id to direct rooms
- Outgoing: Get the room from posted message to reply
- Change Meteor.absoluteUrl to force SSL if Force_SSL is true
@ -529,7 +529,7 @@
- New RocketChat.RateLimiter
- Favico.js update
- Better RTL support
- Remove custom oAuth record when removed from settings
- Remove custom OAuth record when removed from settings
- Improve Settings layout
- Collapse sub groups of settings
- Change translations in PT for False and True

@ -110,7 +110,7 @@ class CustomOAuth
console.log 'id:', JSON.stringify identity, null, ' '
serviceData =
_oAuthCustom: true
_OAuthCustom: true
accessToken: accessToken
_.extend serviceData, identity

@ -1,4 +1,4 @@
RocketChat.settings.addGroup 'Accounts', ->
RocketChat.settings.addGroup 'OAuth', ->
@section 'GitHub Enterprise', ->
enableQuery = {_id: 'Accounts_OAuth_GitHub_Enterprise', value: true}
@add 'Accounts_OAuth_GitHub_Enterprise', false, {type: 'boolean'}

@ -1,4 +1,4 @@
RocketChat.settings.addGroup 'Accounts', ->
RocketChat.settings.addGroup 'OAuth', ->
@section 'GitLab', ->
enableQuery = {_id: 'Accounts_OAuth_Gitlab', value: true}
@add 'Accounts_OAuth_Gitlab', false, { type: 'boolean', public: true }

@ -4,7 +4,7 @@ logger = new Logger 'rocketchat:lib',
type: 'info'
timer = undefined
oAuthServicesUpdate = ->
OAuthServicesUpdate = ->
Meteor.clearTimeout timer if timer?
timer = Meteor.setTimeout ->
@ -55,7 +55,7 @@ oAuthServicesUpdate = ->
, 2000
oAuthServicesRemove = (_id) ->
OAuthServicesRemove = (_id) ->
serviceName = _id.replace('Accounts_OAuth_Custom_', '')
ServiceConfiguration.configurations.remove {service: serviceName.toLowerCase()}
@ -63,12 +63,12 @@ oAuthServicesRemove = (_id) ->
RocketChat.models.Settings.find().observe
added: (record) ->
if /^Accounts_OAuth_.+/.test record._id
oAuthServicesUpdate()
OAuthServicesUpdate()
changed: (record) ->
if /^Accounts_OAuth_.+/.test record._id
oAuthServicesUpdate()
OAuthServicesUpdate()
removed: (record) ->
if /^Accounts_OAuth_Custom.+/.test record._id
oAuthServicesRemove record._id
OAuthServicesRemove record._id

@ -31,7 +31,7 @@ RocketChat.settings.addGroup 'Accounts', ->
@add 'Accounts_AvatarStoreType', 'GridFS', { type: 'select', values: [ { key: 'GridFS', i18nLabel: 'GridFS' }, { key: 'FileSystem', i18nLabel: 'FileSystem' } ] }
@add 'Accounts_AvatarStorePath', '', { type: 'string', enableQuery: {_id: 'Accounts_AvatarStoreType', value: 'FileSystem'} }
RocketChat.settings.addGroup 'oAuth', ->
RocketChat.settings.addGroup 'OAuth', ->
@section 'Facebook', ->
@add 'Accounts_OAuth_Facebook', false, { type: 'boolean', public: true }

@ -1,6 +1,9 @@
RocketChat.settings.add 'API_Wordpress_URL', '', { type: 'string', group: 'Accounts', public: true, section: 'WordPress' }
RocketChat.settings.add 'Accounts_OAuth_Wordpress', false, { type: 'boolean', group: 'Accounts', section: 'WordPress' }
RocketChat.settings.add 'Accounts_OAuth_Wordpress_id', '', { type: 'string', group: 'Accounts', section: 'WordPress' }
RocketChat.settings.add 'Accounts_OAuth_Wordpress_secret', '', { type: 'string', group: 'Accounts', section: 'WordPress' }
RocketChat.settings.add 'Accounts_OAuth_Wordpress_callback_url', __meteor_runtime_config__?.ROOT_URL + '_oauth/wordpress', { type: 'string', blocked: true }
RocketChat.settings.addGroup 'OAuth', ->
@section 'WordPress', ->
enableQuery = {_id: 'Accounts_OAuth_Wordpress', value: true}
@add 'Accounts_OAuth_Wordpress', false, { type: 'boolean', public: true }
@add 'API_Wordpress_URL', '', { type: 'string', enableQuery: enableQuery, public: true }
@add 'Accounts_OAuth_Wordpress_id', '', { type: 'string', enableQuery: enableQuery }
@add 'Accounts_OAuth_Wordpress_secret', '', { type: 'string', enableQuery: enableQuery }
@add 'Accounts_OAuth_Wordpress_callback_url', __meteor_runtime_config__?.ROOT_URL + '_oauth/wordpress', { type: 'string', blocked: true }

@ -1,7 +1,7 @@
orig_updateOrCreateUserFromExternalService = Accounts.updateOrCreateUserFromExternalService
Accounts.updateOrCreateUserFromExternalService = (serviceName, serviceData, options) ->
if serviceName not in ['facebook', 'github', 'gitlab', 'google', 'meteor-developer', 'linkedin', 'twitter', 'sandstorm'] and serviceData._oAuthCustom isnt true
if serviceName not in ['facebook', 'github', 'gitlab', 'google', 'meteor-developer', 'linkedin', 'twitter', 'sandstorm'] and serviceData._OAuthCustom isnt true
return
if serviceName is 'meteor-developer'

Loading…
Cancel
Save