FIX: automatically unstage user when signing in using OAuth

This commit is contained in:
Régis Hanol 2016-04-04 19:04:10 +02:00
parent 332a1ea87e
commit 841f36b058

View file

@ -104,9 +104,11 @@ class Users::OmniauthCallbacksController < ApplicationController
end
def user_found(user)
# automatically activate any account if a provider marked the email valid
if !user.active && @auth_result.email_valid
user.toggle(:active).save
# automatically activate/unstage any account if a provider marked the email valid
if @auth_result.email_valid
user.staged = false
user.active = true
user.save
end
if ScreenedIpAddress.should_block?(request.remote_ip)