Skip to content
Snippets Groups Projects
Commit 0ccaa6df authored by Gabriel Engel's avatar Gabriel Engel
Browse files

oAuth -> OAuth

parent 26ea3ffe
No related merge requests found
......@@ -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
......
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'}
......
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 }
......
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 }
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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment