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|
token = user.tokens.create
UserMailer.lost_password(user, token).deliver_later
flash[:notice] = t "users.lost_password.notice email on way"
token = user.tokens.create
UserMailer.lost_password(user, token).deliver_later
flash[:notice] = t "users.lost_password.notice email on way"
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
token = UserToken.find_by(:token => params[:confirm_string])
if token&.user&.active?
flash[:error] = t("users.confirm.already active")
token = UserToken.find_by(:token => params[:confirm_string])
if token&.user&.active?
flash[:error] = t("users.confirm.already active")
elsif !token || token.expired?
flash[:error] = t("users.confirm.unknown token")
redirect_to :action => "confirm"
elsif !token || token.expired?
flash[:error] = t("users.confirm.unknown token")
redirect_to :action => "confirm"
flash[:notice] = t "users.confirm_resend.success_html", :email => user.email, :sender => Settings.support_email
end
flash[:notice] = t "users.confirm_resend.success_html", :email => user.email, :sender => Settings.support_email
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