From 9bc64e4745112e1c32ada8294c25c417870e8a65 Mon Sep 17 00:00:00 2001 From: Nicolas Besnard Date: Sat, 31 Jan 2015 22:15:25 +0000 Subject: [PATCH] Check if confirmable is active before skipping confirmation --- .../devise_token_auth/omniauth_callbacks_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb index 6896e401d..f3564a04b 100644 --- a/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb +++ b/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb @@ -57,8 +57,10 @@ def omniauth_success extra_params = whitelisted_params @resource.assign_attributes(extra_params) if extra_params - # don't send confirmation email!!! - @resource.skip_confirmation! + if resource_class.devise_modules.include?(:confirmable) + # don't send confirmation email!!! + @resource.skip_confirmation! + end sign_in(:user, @resource, store: false, bypass: false)