<commit_before>class Users::SessionsController < Devise::SessionsController

  def after_sign_in_path_for(resource)
    if stored_path_allows_welcome_screen? && resource.show_welcome_screen?
      welcome_path
    else
      super
    end
  end

  private

    def stored_path_allows_welcome_screen?
      stored_path = session[stored_location_key_for(resource)]
      stored_path[0..5] != "/email"
    end

end<commit_msg>Fixes issue when a user does login without stored path<commit_after>class Users::SessionsController < Devise::SessionsController

  def after_sign_in_path_for(resource)
    if stored_path_allows_welcome_screen? && resource.show_welcome_screen?
      welcome_path
    else
      super
    end
  end

  private

    def stored_path_allows_welcome_screen?
      stored_path = session[stored_location_key_for(resource)]
      stored_path && stored_path[0..5] != "/email"
    end

end
{'fraction_non_alphanumeric': 0.06873614190687362, 'fraction_numerical': 0.004434589800443459, 'mean_word_length': 4.073033707865169, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3738364', 'n_tokens_mistral': 291, 'n_tokens_neox': 286, 'n_words': 53}