+ user = users.first if users.count == 1
+ end
+
+ if user
+ token = user.generate_token_for(:password_reset)
+ UserMailer.lost_password(user, token).deliver_later
+ end
+
+ flash[:notice] = t ".send_paranoid_instructions"
+ redirect_to login_path
+ end
+
+ def update
+ if params[:token]
+ self.current_user = User.find_by_token_for(:password_reset, params[:token]) ||
+ UserToken.unexpired.find_by(:token => params[:token])&.user