FIX: automatically unstage user when signing in using OAuth
This commit is contained in:
parent
332a1ea87e
commit
841f36b058
1 changed files with 5 additions and 3 deletions
|
@ -104,9 +104,11 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def user_found(user)
|
def user_found(user)
|
||||||
# automatically activate any account if a provider marked the email valid
|
# automatically activate/unstage any account if a provider marked the email valid
|
||||||
if !user.active && @auth_result.email_valid
|
if @auth_result.email_valid
|
||||||
user.toggle(:active).save
|
user.staged = false
|
||||||
|
user.active = true
|
||||||
|
user.save
|
||||||
end
|
end
|
||||||
|
|
||||||
if ScreenedIpAddress.should_block?(request.remote_ip)
|
if ScreenedIpAddress.should_block?(request.remote_ip)
|
||||||
|
|
Reference in a new issue