remove duplicate code

This commit is contained in:
Régis Hanol 2018-05-11 12:16:37 +02:00
parent 1404294a12
commit 2958e17cde

View File

@ -65,16 +65,6 @@ class SessionController < ApplicationController
current_user.user_profile.card_background
) if current_user.user_profile.card_background.present?
sso.avatar_url = Discourse.store.cdn_url UrlHelper.absolute(
"#{Discourse.store.absolute_base_url}/#{Discourse.store.get_path_for_upload(current_user.uploaded_avatar)}"
) unless current_user.uploaded_avatar.nil?
sso.profile_background_url = UrlHelper.absolute upload_cdn_path(
current_user.user_profile.profile_background
) if current_user.user_profile.profile_background.present?
sso.card_background_url = UrlHelper.absolute upload_cdn_path(
current_user.user_profile.card_background
) if current_user.user_profile.card_background.present?
if sso.return_sso_url.blank?
render plain: "return_sso_url is blank, it must be provided", status: 400
return