diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index b90631f..b9d4471 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -65,7 +65,7 @@ class SessionsController < ApplicationController end def google_remove - current_user.google.destroy + current_user.google.destroy rescue "" redirect_to admin_member_path(current_user.member_profile.to_param) and return end diff --git a/app/views/admin/members/_user_social.html.erb b/app/views/admin/members/_user_social.html.erb index ff0c05f..37fe06e 100644 --- a/app/views/admin/members/_user_social.html.erb +++ b/app/views/admin/members/_user_social.html.erb @@ -2,7 +2,7 @@

<%= t("social_profile_connections")%>

<% if current_site.google_oauth_enabled %> -
Google type="checkbox" id="google_connect_box" class="toggle-check set-sidebar-state" data-disabled="true">
+
Google type="checkbox" id="google_connect_box" class="set-sidebar-state" data-disabled="true">
<% end %>
\ No newline at end of file diff --git a/app/views/admin/members/show.html.erb b/app/views/admin/members/show.html.erb index 9dc50b2..2ea6d2a 100644 --- a/app/views/admin/members/show.html.erb +++ b/app/views/admin/members/show.html.erb @@ -72,8 +72,10 @@ $("#google_connect_box").on("click",function(){ $("#google_connection div.main_text").css("opacity","0.5"); $("#google_connection div.wait_text").show(); - if($(this).parent().hasClass("disable")){ - if(confirm("Are you sure?")){ + if($(this).is(":checked")){ + window.location.href = "/auth/google_oauth2"; + }else{ + if(confirm("Are you sure?")){ window.location.href = "/auth/google_oauth2/remove"; }else{ $("#google_connection div.main_text").css("opacity","1");