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

Merge pull request #2423 from LearnersGuild/jw/fix-oauth2-for-auth0

fix custom OAuth2 functionality to work with Auth0
parents 7ff1ea47 876d7d80
No related branches found
No related tags found
No related merge requests found
......@@ -103,6 +103,10 @@ class CustomOAuth
if identity?.ID and not identity.id
identity.id = identity.ID
# Fix Auth0-like identities having 'user_id' instead of 'id'
if identity?.user_id and not identity.id
identity.id = identity.user_id
console.log 'id:', JSON.stringify identity, null, ' '
serviceData =
......
......@@ -8,12 +8,11 @@ oAuthServicesUpdate = ->
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-z0-9_-]+$/i}).fetch()
for service in services
logger.oauth_updated service._id
serviceName = service._id.replace('Accounts_OAuth_', '')
if serviceName is 'Meteor'
serviceName = '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