Merge pull request #3163 from rcfox/fix-by-external

Allow periods in the external_id value used in the /users/by-external route.
This commit is contained in:
Sam
2015-06-24 13:07:12 +10:00
3 changed files with 10 additions and 2 deletions

View File

@ -269,7 +269,8 @@ class ApplicationController < ActionController::Base
find_opts[:active] = true unless opts[:include_inactive]
User.find_by(find_opts)
elsif params[:external_id]
SingleSignOnRecord.find_by(external_id: params[:external_id]).try(:user)
external_id = params[:external_id].gsub(/\.json$/, '')
SingleSignOnRecord.find_by(external_id: external_id).try(:user)
end
raise Discourse::NotFound if user.blank?