Skip to content

Commit

Permalink
dev(auth-v2): rename variable to debtcollective_after_signup_redirect…
Browse files Browse the repository at this point in the history
…_url
  • Loading branch information
orlando committed Feb 11, 2021
1 parent b1b6ff4 commit d1e9ded
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ en:
debtcollective_algolia_app_id: 'Algolia Places App ID'
debtcollective_algolia_api_key: 'Algolia Places API key'
debtcollective_algolia_api_key: 'Algolia Places API key'
debtcollective_redirect_url_after_signup: 'Redirect URL after user accepts an invite. ex https://debtcollective.org/hub'
debtcollective_after_signup_redirect_url: 'Redirect URL after user accepts an invite. ex https://debtcollective.org/hub'
2 changes: 1 addition & 1 deletion config/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ plugins:
debtcollective_solidarity_message_title:
default: "Solidarity Bloc"
client: false
debtcollective_redirect_url_after_signup:
debtcollective_after_signup_redirect_url:
default: "https://debtcollective.org/hub"
client: true
2 changes: 1 addition & 1 deletion lib/extensions/invites_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def perform_accept_invitation

# If this is a new user or first login, redirect
# we only set it if topic invite is nil
redirect_to = SiteSetting.debtcollective_redirect_url_after_signup
redirect_to = SiteSetting.debtcollective_after_signup_redirect_url
if (user.new_user? || !user.seen_before?) && redirect_to.present? && topic.blank?
response[:redirect_to] = redirect_to
end
Expand Down
2 changes: 1 addition & 1 deletion lib/extensions/session_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def email_login

response = { success: 'OK' }

redirect_to = SiteSetting.debtcollective_redirect_url_after_signup
redirect_to = SiteSetting.debtcollective_after_signup_redirect_url
response[:redirect_to] = redirect_to if redirect_to.present? && !user.seen_before?

return render json: response
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/session_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
it "redirects to after_signup_path if it's the first login" do
user = Fabricate(:user)
email_token = user.email_tokens.create!(email: user.email)
SiteSetting.debtcollective_redirect_url_after_signup = "https://example.com"
SiteSetting.debtcollective_after_signup_redirect_url = "https://example.com"

post "/session/email-login/#{email_token.token}", headers: { "ACCEPT" => "application/json" }
json = JSON.parse(response.body)
Expand Down

0 comments on commit d1e9ded

Please sign in to comment.