if params[:user][:auth_provider].blank? ||
(params[:user][:auth_provider] == current_user.auth_provider &&
params[:user][:auth_uid] == current_user.auth_uid)
update_user(current_user, params)
if params[:user][:auth_provider].blank? ||
(params[:user][:auth_provider] == current_user.auth_provider &&
params[:user][:auth_uid] == current_user.auth_uid)
update_user(current_user, params)
end
elsif errors = session.delete(:user_errors)
errors.each do |attribute, error|
end
elsif errors = session.delete(:user_errors)
errors.each do |attribute, error|
elsif current_user.auth_provider.present?
# Verify external authenticator before moving on
session[:new_user] = current_user
elsif current_user.auth_provider.present?
# Verify external authenticator before moving on
session[:new_user] = current_user
session[:remember_me] ||= params[:remember_me]
password_authentication(params[:username], params[:password])
end
session[:remember_me] ||= params[:remember_me]
password_authentication(params[:username], params[:password])
end
session[:user_errors] = current_user.errors.as_json
redirect_to :action => "account", :display_name => current_user.display_name
session[:user_errors] = current_user.errors.as_json
redirect_to :action => "account", :display_name => current_user.display_name