<commit_before>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :omniauthable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me


  def self.find_for_github_oauth(access_token, signed_in_resource=nil)
    data = access_token.extra.raw_info
    if data.email
      if user = User.where(:email => data.email).first
        user
      else
        User.create!(:email => data.email, :password => <PASSWORD>ise.friendly_token[0,20]) 
      end
    else
      flash[:error] = I18n.t 'devise.omniauth_callbacks.noemail', kind: "Github"
    end
  end

end<commit_msg>just return nil and let the controller handle this<commit_after>class User < ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :omniauthable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me


  def self.find_for_github_oauth(access_token, signed_in_resource=nil)
    data = access_token.extra.raw_info
    if data.email
      if user = User.where(:email => data.email).first
        user
      else
        User.create!(:email => data.email, :password => <PASSWORD>ise.friendly_token[0,20]) 
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.0967741935483871, 'fraction_numerical': 0.004527447651386531, 'mean_word_length': 4.037037037037037, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '4181481', 'n_tokens_mistral': 551, 'n_tokens_neox': 520, 'n_words': 131}