FIX: always unstage users when they log in

This commit is contained in:
Régis Hanol
2018-05-13 17:00:02 +02:00
parent be6404d651
commit 2cf6fb7359
5 changed files with 33 additions and 9 deletions

View File

@ -125,7 +125,8 @@ class Users::OmniauthCallbacksController < ApplicationController
# automatically activate/unstage any account if a provider marked the email valid
if @auth_result.email_valid && @auth_result.email == user.email
user.update!(staged: false)
user.unstage
user.save
# ensure there is an active email token
unless EmailToken.where(email: user.email, confirmed: true).exists? ||