Invite link can't be used to log in after you set a password or sign in with 3rd party

This commit is contained in:
Neil Lalonde
2014-01-21 16:53:46 -05:00
parent 1dbc1c56b4
commit da825451d0
6 changed files with 60 additions and 5 deletions

View File

@ -85,8 +85,8 @@ class Users::OmniauthCallbacksController < ApplicationController
# log on any account that is active with forum access
if Guardian.new(user).can_access_forum? && user.active
log_on_user(user)
# don't carry around old auth info, perhaps move elsewhere
session[:authentication] = nil
Invite.invalidate_for_email(user.email) # invite link can't be used to log in anymore
session[:authentication] = nil # don't carry around old auth info, perhaps move elsewhere
@data.authenticated = true
else
if SiteSetting.must_approve_users? && !user.approved?