From 66cb24dddf898f61f12f77c1bc5468c7bb400f61 Mon Sep 17 00:00:00 2001 From: Ben Halpern Date: Tue, 12 Jun 2018 22:19:44 -0400 Subject: [PATCH] Fix callback issue --- app/controllers/omniauth_callbacks_controller.rb | 1 + app/views/articles/_main_stories_feed.html.erb | 2 +- app/views/articles/_sidebar_additional.html.erb | 2 +- app/views/devise/registrations/_registration_form.html.erb | 2 +- app/views/giveaways/edit.html.erb | 2 +- app/views/layouts/_nav_menu.html.erb | 2 +- app/views/layouts/_signup_modal.html.erb | 2 +- app/views/notifications/_signup_cta_test.html.erb | 4 ++-- app/views/pages/membership_form.html.erb | 2 +- spec/features/user_views_and_closes_onboarding_spec.rb | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb index 2e8d83349..ac7acc1d0 100644 --- a/app/controllers/omniauth_callbacks_controller.rb +++ b/app/controllers/omniauth_callbacks_controller.rb @@ -4,6 +4,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController # raise env["omniauth.auth"].to_yaml class_eval %Q{ def #{provider} + raise cta_variant = request.env["omniauth.params"]['state'].to_s @user = AuthorizationService.new(request.env["omniauth.auth"], current_user, cta_variant).get_user if @user.persisted? diff --git a/app/views/articles/_main_stories_feed.html.erb b/app/views/articles/_main_stories_feed.html.erb index da81c9165..04ed51786 100644 --- a/app/views/articles/_main_stories_feed.html.erb +++ b/app/views/articles/_main_stories_feed.html.erb @@ -14,7 +14,7 @@ <% end %>
- + TWITTER diff --git a/app/views/articles/_sidebar_additional.html.erb b/app/views/articles/_sidebar_additional.html.erb index 6dde8c2b6..1d6b1ef46 100644 --- a/app/views/articles/_sidebar_additional.html.erb +++ b/app/views/articles/_sidebar_additional.html.erb @@ -56,7 +56,7 @@ - +
Via Twitter
diff --git a/app/views/layouts/_signup_modal.html.erb b/app/views/layouts/_signup_modal.html.erb index db7c8c04b..970a6694b 100644 --- a/app/views/layouts/_signup_modal.html.erb +++ b/app/views/layouts/_signup_modal.html.erb @@ -17,7 +17,7 @@

We’re a place where coders share, stay up-to-date and grow their careers.

-
+ or
@@ -21,7 +21,7 @@ Create your account to customize your feed and start participating.

- + or
diff --git a/app/views/pages/membership_form.html.erb b/app/views/pages/membership_form.html.erb index 6a2ae2fec..6518bcba6 100644 --- a/app/views/pages/membership_form.html.erb +++ b/app/views/pages/membership_form.html.erb @@ -19,7 +19,7 @@ " /> " />

Sign in to get your membership

- + TWITTER diff --git a/spec/features/user_views_and_closes_onboarding_spec.rb b/spec/features/user_views_and_closes_onboarding_spec.rb index 19396facf..f17eeaf08 100644 --- a/spec/features/user_views_and_closes_onboarding_spec.rb +++ b/spec/features/user_views_and_closes_onboarding_spec.rb @@ -75,7 +75,7 @@ # end # it "with Twitter" do -# # in_feed_link = find_link(href: "/users/auth/twitter?callback_url=https://dev.to") +# # in_feed_link = find_link(href: "/users/auth/twitter?callback_url=https://dev.to/users/auth/twitter/callback") # # in_feed_link.click # # expect(find(".global-modal-inner")).to have_content("WELCOME!") # end