diff --git a/BrainPortal/app/controllers/users_controller.rb b/BrainPortal/app/controllers/users_controller.rb index 1dbc46706..c91a0943e 100644 --- a/BrainPortal/app/controllers/users_controller.rb +++ b/BrainPortal/app/controllers/users_controller.rb @@ -356,9 +356,11 @@ def send_password #:nodoc: @user = User.where( :login => params[:login], :email => params[:email] ).first if @user if user_must_link_to_globus?(@user) - cb_error "Your account can only authenticate with Globus identities.", :redirect => user_path(current_user) + contact = RemoteResource.current_resource.support_email.presence || User.admin.email.presence || "the support staff" + wipe_user_password_after_globus_link(@user) # for legacy or erroneously set users + flash[:error] = "You cannot access the portal with password. Thus you cannot reset password.Your account can only authenticate with Globus identities. please write to #{contact} for help" respond_to do |format| - format.html { redirect_to :controller => :sessions, :action => :mandatory_globus } + format.html { redirect_to login_path } format.any { head :unauthorized } end return