Remove the .json part from the external_id value when using it to lookup a user.

This commit is contained in:
Ryan Fox 2015-02-02 12:58:02 -05:00
parent 1f0915bf83
commit c3f21dcdfc
1 changed files with 2 additions and 1 deletions

View File

@ -239,7 +239,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.new if user.blank?