Skip to content

Commit

Permalink
prevent global only user to reset password (verbiage, spacing) aces#1391
Browse files Browse the repository at this point in the history
  • Loading branch information
MontrealSergiy committed May 14, 2024
1 parent 54c1fa5 commit 6f79b59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BrainPortal/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,11 @@ def request_password #:nodoc:
def send_password #:nodoc:
@user = User.where( :login => params[:login], :email => params[:email] ).first
if @user

if user_must_link_to_globus?(@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"
flash[:error] = "Your account can only authenticate with Globus identities. Thus you are not allowed to use or reset password. Please contact #{contact} for help."
respond_to do |format|
format.html { redirect_to login_path }
format.any { head :unauthorized }
Expand Down

0 comments on commit 6f79b59

Please sign in to comment.