forked from External/greenlight
		
	Fix issue with flash messages and activation link (#454)
This commit is contained in:
		
				
					committed by
					
						
						Jesus Federico
					
				
			
			
				
	
			
			
			
						parent
						
							c595ba9895
						
					
				
				
					commit
					6bd5d81697
				
			@@ -30,9 +30,11 @@ class PasswordResetsController < ApplicationController
 | 
				
			|||||||
    if @user
 | 
					    if @user
 | 
				
			||||||
      @user.create_reset_digest
 | 
					      @user.create_reset_digest
 | 
				
			||||||
      @user.send_password_reset_email(reset_link)
 | 
					      @user.send_password_reset_email(reset_link)
 | 
				
			||||||
      redirect_to root_url, notice: I18n.t("email_sent")
 | 
					      flash[:success] = I18n.t("email_sent")
 | 
				
			||||||
 | 
					      redirect_to root_path
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      redirect_to new_password_reset_path, alert: I18n.t("no_user_email_exists")
 | 
					      flash[:alert] = I18n.t("no_user_email_exists")
 | 
				
			||||||
 | 
					      redirect_to new_password_reset_path
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  rescue => e
 | 
					  rescue => e
 | 
				
			||||||
    logger.error "Error in email delivery: #{e}"
 | 
					    logger.error "Error in email delivery: #{e}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ class UsersController < ApplicationController
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    # Start email verification and redirect to root.
 | 
					    # Start email verification and redirect to root.
 | 
				
			||||||
    begin
 | 
					    begin
 | 
				
			||||||
      @user.send_activation_email(verification_link)
 | 
					      @user.send_activation_email(user_verification_link)
 | 
				
			||||||
    rescue => e
 | 
					    rescue => e
 | 
				
			||||||
      logger.error "Error in email delivery: #{e}"
 | 
					      logger.error "Error in email delivery: #{e}"
 | 
				
			||||||
      flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error"))
 | 
					      flash[:alert] = I18n.t(params[:message], default: I18n.t("delivery_error"))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user