<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,7 +4,7 @@ class SessionsController &lt; ApplicationController
 
   def create
     logout_keeping_session!
-    user = User.authenticate(params[:login], params[:password])
+    user = User.authenticate(params[:email], params[:password])
     if user
       self.current_user = user
       new_cookie_flag = (params[:remember_me] == &quot;1&quot;)
@@ -13,7 +13,7 @@ class SessionsController &lt; ApplicationController
       flash[:notice] = &quot;Logged in successfully&quot;
     else
       note_failed_signin
-      @login       = params[:login]
+      @email       = params[:email]
       @remember_me = params[:remember_me]
       render :action =&gt; 'new'
     end
@@ -28,7 +28,7 @@ class SessionsController &lt; ApplicationController
   protected
 
   def note_failed_signin
-    flash[:error] = &quot;Couldn't log you in as '#{params[:login]}'&quot;
-    logger.warn &quot;Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}&quot;
+    flash[:warning] = &quot;Couldn't log you in as '#{params[:email]}'&quot;
+    logger.warn &quot;Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}&quot;
   end
 end</diff>
      <filename>app/controllers/sessions_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -45,7 +45,7 @@ module UsersHelper
   #
   def link_to_user(user, options={})
     raise &quot;Invalid user&quot; unless user
-    options.reverse_merge! :content_method =&gt; :login, :title_method =&gt; :login, :class =&gt; :nickname
+    options.reverse_merge! :content_method =&gt; :email, :title_method =&gt; :email, :class =&gt; :nickname
     content_text      = options.delete(:content_text)
     content_text    ||= user.send(options.delete(:content_method))
     options[:title] ||= user.send(options.delete(:title_method))</diff>
      <filename>app/helpers/users_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,10 +6,6 @@ class User &lt; ActiveRecord::Base
   include Authentication::ByCookieToken
   include Authorization::AasmRoles
 
-  validates_presence_of :login
-  validates_length_of :login, :within =&gt; 3..40
-  validates_uniqueness_of :login, :case_sensitive =&gt; false
-  validates_format_of :login, :with =&gt; RE_LOGIN_OK, :message =&gt; MSG_LOGIN_BAD
   validates_format_of :name, :with =&gt; RE_NAME_OK, :message =&gt; MSG_NAME_BAD, :allow_nil =&gt; true
   validates_length_of :name, :maximum =&gt; 100
   validates_presence_of :email
@@ -20,7 +16,7 @@ class User &lt; ActiveRecord::Base
   # HACK HACK HACK -- how to do attr_accessible from here?
   # prevents a user from submitting a crafted form that bypasses activation
   # anything else you want your user to change should be added here.
-  attr_accessible :login, :email, :name, :password, :password_confirmation
+  attr_accessible :email, :name, :password, :password_confirmation
 
   # Authenticates a user by their login name and unencrypted password.  Returns the user or nil.
   #
@@ -28,8 +24,8 @@ class User &lt; ActiveRecord::Base
   # We really need a Dispatch Chain here or something.
   # This will also let us return a human error message.
   #
-  def self.authenticate(login, password)
-    u = find_in_state :first, :active, :conditions =&gt; { :login =&gt; login } # need to get the salt
+  def self.authenticate(email, password)
+    u = find_in_state :first, :active, :conditions =&gt; { :email =&gt; email } # need to get the salt
     u &amp;&amp; u.authenticated?(password) ? u : nil
   end
 </diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
-&lt;%= @user.login %&gt;, you can change your password at this URL:
+&lt;%= @user.name %&gt;, you can change your password at this URL:
 
 &lt;%= @url %&gt;
\ No newline at end of file</diff>
      <filename>app/views/password_mailer/forgot_password.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1 @@
-&lt;%= @user.login %&gt;, your password has been reset.
\ No newline at end of file
+&lt;%= @user.name %&gt;, your password has been reset.
\ No newline at end of file</diff>
      <filename>app/views/password_mailer/reset_password.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -4,8 +4,8 @@
 		&lt;legend&gt;Your Details&lt;/legend&gt;
 		&lt;ol&gt;
 			&lt;li&gt;
-				&lt;%= label_tag 'login', 'Username' %&gt;
-				&lt;%= text_field_tag 'login', @login %&gt;
+				&lt;%= label_tag 'email', 'Email' %&gt;
+				&lt;%= text_field_tag 'email', @email %&gt;
 			&lt;/li&gt;
 			&lt;li&gt;
 				&lt;%= label_tag 'password' %&gt;</diff>
      <filename>app/views/sessions/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,3 @@
-&lt;%= @user.login %&gt;, your account has been activated.  Welcome aboard!
+&lt;%= @user.name %&gt;, your account has been activated.  Welcome aboard!
 
 &lt;%= @url %&gt;</diff>
      <filename>app/views/user_mailer/activation.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,6 @@
 Your account has been created.
 
-Username: &lt;%= @user.login %&gt;
+Username: &lt;%= @user.email %&gt;
 Password: &lt;%= @user.password %&gt;
 
 Visit this url to activate your account:</diff>
      <filename>app/views/user_mailer/signup_notification.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -6,8 +6,8 @@
 		&lt;legend&gt;Your Details&lt;/legend&gt;
 		&lt;ol&gt;
 			&lt;li&gt;
-				&lt;%= f.label :login, 'Username' %&gt;
-				&lt;%= f.text_field :login %&gt;
+				&lt;%= f.label :name, 'Name' %&gt;
+				&lt;%= f.text_field :name %&gt;
 			&lt;/li&gt;
 			&lt;li&gt;
 				&lt;%= f.label :email %&gt;</diff>
      <filename>app/views/users/new.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,6 @@
 class CreateUsers &lt; ActiveRecord::Migration
   def self.up
     create_table :users do |t|
-      t.string :login, :limit =&gt; 40
       t.string :name, :limit =&gt; 100, :default =&gt; '', :null =&gt; true
       t.string :email, :limit =&gt; 100
       t.string :crypted_password, :limit =&gt; 40
@@ -14,7 +13,7 @@ class CreateUsers &lt; ActiveRecord::Migration
       t.datetime :deleted_at
       t.timestamps
     end
-    add_index :users, :login, :unique =&gt; true
+    add_index :users, :email, :unique =&gt; true
   end
 
   def self.down</diff>
      <filename>db/migrate/20080811094730_create_users.rb</filename>
    </modified>
    <modified>
      <diff>@@ -108,8 +108,8 @@ module AuthenticatedSystem
 
     # Called from #current_user.  Now, attempt to login by basic authentication information.
     def login_from_basic_auth
-      authenticate_with_http_basic do |login, password|
-        self.current_user = User.authenticate(login, password)
+      authenticate_with_http_basic do |email, password|
+        self.current_user = User.authenticate(email, password)
       end
     end
     </diff>
      <filename>lib/authenticated_system.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,13 +5,13 @@ module AuthenticatedTestHelper
   end
 
   def authorize_as(user)
-    @request.env[&quot;HTTP_AUTHORIZATION&quot;] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).login, 'monkey') : nil
+    @request.env[&quot;HTTP_AUTHORIZATION&quot;] = user ? ActionController::HttpAuthentication::Basic.encode_credentials(users(user).email, 'monkey') : nil
   end
   
   # rspec
   def mock_user
     user = mock_model(User, :id =&gt; 1,
-      :login  =&gt; 'user_name',
+      :email  =&gt; 'user_email',
       :name   =&gt; 'U. Surname',
       :to_xml =&gt; &quot;User-in-XML&quot;, :to_json =&gt; &quot;User-in-JSON&quot;, 
       :errors =&gt; [])</diff>
      <filename>lib/authenticated_test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,8 +8,8 @@ describe SessionsController do
   fixtures        :users
   before do 
     @user  = mock_user
-    @login_params = { :login =&gt; 'quentin', :password =&gt; 'test' }
-    User.stub!(:authenticate).with(@login_params[:login], @login_params[:password]).and_return(@user)
+    @login_params = { :email =&gt; 'quentin@example.com', :password =&gt; 'test' }
+    User.stub!(:authenticate).with(@login_params[:email], @login_params[:password]).and_return(@user)
   end
   def do_create
     post :create, @login_params
@@ -73,10 +73,9 @@ describe SessionsController do
   describe &quot;on failed login&quot; do
     before do
       User.should_receive(:authenticate).with(anything(), anything()).and_return(nil)
-      login_as :quentin
     end
     it 'logs out keeping session'   do controller.should_receive(:logout_keeping_session!); do_create end
-    it 'flashes an error'           do do_create; flash[:error].should =~ /Couldn't log you in as 'quentin'/ end
+    it 'flashes an error'           do do_create; flash[:warning].should =~ /Couldn't log you in/ end
     it 'renders the log in page'    do do_create; response.should render_template('new')  end
     it &quot;doesn't log me in&quot;          do do_create; controller.send(:logged_in?).should == false end
     it &quot;doesn't send password back&quot; do </diff>
      <filename>spec/controllers/sessions_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -26,13 +26,6 @@ describe UsersController do
     assigns(:user).reload
     assigns(:user).activation_code.should_not be_nil
   end
-  it 'requires login on signup' do
-    lambda do
-      create_user(:login =&gt; nil)
-      assigns[:user].errors.on(:login).should_not be_nil
-      response.should be_success
-    end.should_not change(User, :count)
-  end
   
   it 'requires password on signup' do
     lambda do
@@ -60,12 +53,12 @@ describe UsersController do
   
   
   it 'activates user' do
-    User.authenticate('aaron', 'monkey').should be_nil
+    User.authenticate('aaron@example.com', 'monkey').should be_nil
     get :activate, :activation_code =&gt; users(:aaron).activation_code
     response.should redirect_to('/login')
     flash[:notice].should_not be_nil
     flash[:error ].should     be_nil
-    User.authenticate('aaron', 'monkey').should == users(:aaron)
+    User.authenticate('aaron@example.com', 'monkey').should == users(:aaron)
   end
   
   it 'does not activate user without key' do
@@ -87,7 +80,7 @@ describe UsersController do
   end
   
   def create_user(options = {})
-    post :create, :user =&gt; { :login =&gt; 'quire', :email =&gt; 'quire@example.com',
+    post :create, :user =&gt; { :email =&gt; 'quire@example.com',
       :password =&gt; 'quire69', :password_confirmation =&gt; 'quire69' }.merge(options)
   end
 end</diff>
      <filename>spec/controllers/users_controller_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,6 @@
 
 quentin:
   id:                        1
-  login:                     quentin
   email:                     quentin@example.com
   salt:                      356a192b7913b04c54574d18c28d46e6395428ab # SHA1('0')
   crypted_password:          261fd559c11e3931bd9f87fe8babb4ee8b196c56 # 'monkey'
@@ -14,7 +13,6 @@ quentin:
       
 aaron:
   id:                        2
-  login:                     aaron
   email:                     aaron@example.com
   salt:                      da4b9237bacccdf19c0760cab7aec4a8359010b0 # SHA1('1')
   crypted_password:          92e0e243685cb0159b1cec342fbb9a92fc8a86fa # 'monkey'
@@ -29,7 +27,6 @@ aaron:
 
 old_password_holder:
   id:                        3
-  login:                     old_password_holder
   email:                     salty_dog@example.com
   salt:                      7e3041ebc2fc05a40c60028e2c4901a81035d3cd
   crypted_password:          00742970dc9e6319f8019fd54864d3ea740f04b1 # test</diff>
      <filename>spec/fixtures/users.yml</filename>
    </modified>
    <modified>
      <diff>@@ -31,13 +31,13 @@ describe UsersHelper do
       link_to_user(@user, :content_text =&gt; 'Hello there!').should have_tag(&quot;a&quot;, 'Hello there!')
     end
     it &quot;should use the login as link text with no :content_method specified&quot; do
-      link_to_user(@user).should have_tag(&quot;a&quot;, 'user_name')
+      link_to_user(@user).should have_tag(&quot;a&quot;, 'user_email')
     end
     it &quot;should use the name as link text with :content_method =&gt; :name&quot; do
       link_to_user(@user, :content_method =&gt; :name).should have_tag(&quot;a&quot;, 'U. Surname')
     end
     it &quot;should use the login as title with no :title_method specified&quot; do
-      link_to_user(@user).should have_tag(&quot;a[title='user_name']&quot;)
+      link_to_user(@user).should have_tag(&quot;a[title='user_email']&quot;)
     end
     it &quot;should use the name as link title with :content_method =&gt; :name&quot; do
       link_to_user(@user, :title_method =&gt; :name).should have_tag(&quot;a[title='U. Surname']&quot;)
@@ -91,13 +91,13 @@ describe UsersHelper do
       link_to_current_user(:content_text =&gt; 'Hello there!').should have_tag(&quot;a&quot;, 'Hello there!')
     end
     it &quot;should use the login as link text with no :content_method specified&quot; do
-      link_to_current_user().should have_tag(&quot;a&quot;, 'user_name')
+      link_to_current_user().should have_tag(&quot;a&quot;, 'user_email')
     end
     it &quot;should use the name as link text with :content_method =&gt; :name&quot; do
       link_to_current_user(:content_method =&gt; :name).should have_tag(&quot;a&quot;, 'U. Surname')
     end
     it &quot;should use the login as title with no :title_method specified&quot; do
-      link_to_current_user().should have_tag(&quot;a[title='user_name']&quot;)
+      link_to_current_user().should have_tag(&quot;a[title='user_email']&quot;)
     end
     it &quot;should use the name as link title with :content_method =&gt; :name&quot; do
       link_to_current_user(:title_method =&gt; :name).should have_tag(&quot;a[title='U. Surname']&quot;)</diff>
      <filename>spec/helpers/users_helper_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -38,36 +38,6 @@ describe User do
   # Validations
   #
 
-  it 'requires login' do
-    lambda do
-      u = create_user(:login =&gt; nil)
-      u.errors.on(:login).should_not be_nil
-    end.should_not change(User, :count)
-  end
-
-  describe 'allows legitimate logins:' do
-    ['123', '1234567890_234567890_234567890_234567890',
-     'hello.-_there@funnychar.com'].each do |login_str|
-      it &quot;'#{login_str}'&quot; do
-        lambda do
-          u = create_user(:login =&gt; login_str)
-          u.errors.on(:login).should     be_nil
-        end.should change(User, :count).by(1)
-      end
-    end
-  end
-  describe 'disallows illegitimate logins:' do
-    ['12', '1234567890_234567890_234567890_234567890_', &quot;tab\t&quot;, &quot;newline\n&quot;,
-     &quot;I&#241;t&#235;rn&#226;ti&#244;n&#224;liz&#230;ti&#248;n hasn't happened to ruby 1.8 yet&quot;,
-     'semicolon;', 'quote&quot;', 'tick\'', 'backtick`', 'percent%', 'plus+', 'space '].each do |login_str|
-      it &quot;'#{login_str}'&quot; do
-        lambda do
-          u = create_user(:login =&gt; login_str)
-          u.errors.on(:login).should_not be_nil
-        end.should_not change(User, :count)
-      end
-    end
-  end
 
   it 'requires password' do
     lambda do
@@ -147,12 +117,12 @@ describe User do
 
   it 'resets password' do
     users(:quentin).update_attributes(:password =&gt; 'new password', :password_confirmation =&gt; 'new password')
-    User.authenticate('quentin', 'new password').should == users(:quentin)
+    User.authenticate('quentin@example.com', 'new password').should == users(:quentin)
   end
 
   it 'does not rehash password' do
-    users(:quentin).update_attributes(:login =&gt; 'quentin2')
-    User.authenticate('quentin2', 'monkey').should == users(:quentin)
+    users(:quentin).update_attributes(:email =&gt; 'quentin2@example.com')
+    User.authenticate('quentin2@example.com', 'monkey').should == users(:quentin)
   end
 
   #
@@ -160,28 +130,28 @@ describe User do
   #
 
   it 'authenticates user' do
-    User.authenticate('quentin', 'monkey').should == users(:quentin)
+    User.authenticate('quentin@example.com', 'monkey').should == users(:quentin)
   end
 
   it &quot;doesn't authenticate user with bad password&quot; do
-    User.authenticate('quentin', 'invalid_password').should be_nil
+    User.authenticate('quentin@example.com', 'invalid_password').should be_nil
   end
 
  if REST_AUTH_SITE_KEY.blank?
    # old-school passwords
    it &quot;authenticates a user against a hard-coded old-style password&quot; do
-     User.authenticate('old_password_holder', 'test').should == users(:old_password_holder)
+     User.authenticate('salty_dog@example.com', 'test').should == users(:old_password_holder)
    end
  else
    it &quot;doesn't authenticate a user against a hard-coded old-style password&quot; do
-     User.authenticate('old_password_holder', 'test').should be_nil
+     User.authenticate('salty_dog@example.com', 'test').should be_nil
    end
 
    # New installs should bump this up and set REST_AUTH_DIGEST_STRETCHES to give a 10ms encrypt time or so
    desired_encryption_expensiveness_ms = 0.1
    it &quot;takes longer than #{desired_encryption_expensiveness_ms}ms to encrypt a password&quot; do
      test_reps = 100
-     start_time = Time.now; test_reps.times{ User.authenticate('quentin', 'monkey'+rand.to_s) }; end_time   = Time.now
+     start_time = Time.now; test_reps.times{ User.authenticate('quentin@example.com', 'monkey'+rand.to_s) }; end_time   = Time.now
      auth_time_ms = 1000 * (end_time - start_time)/test_reps
      auth_time_ms.should &gt; desired_encryption_expensiveness_ms
    end
@@ -283,7 +253,7 @@ describe User do
 
 protected
   def create_user(options = {})
-    record = User.new({ :login =&gt; 'quire', :email =&gt; 'quire@example.com', :password =&gt; 'quire69', :password_confirmation =&gt; 'quire69' }.merge(options))
+    record = User.new({ :email =&gt; 'quire@example.com', :password =&gt; 'quire69', :password_confirmation =&gt; 'quire69' }.merge(options))
     record.register! if record.valid?
     record
   end</diff>
      <filename>spec/models/user_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -48,8 +48,8 @@ module ToFooFromStory
   end
   # Coverts an attribute list found in the steps into an array
   # Example:
-  #   login, email, updated_at, and gravatar
-  #   # =&gt; ['login', 'email', 'updated_at', 'gravatar']
+  #   email, updated_at, and gravatar
+  #   # =&gt; ['email', 'updated_at', 'gravatar']
   def to_array_from_story
     self.split(/,? and |, /).map do |value|
       ToFooFromStory::fix_value(value)</diff>
      <filename>stories/rest_auth_stories_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>560f3844ad9aff878c1e830eef851b442865154b</id>
    </parent>
  </parents>
  <author>
    <name>unknown</name>
    <email>Matt@.(none)</email>
  </author>
  <url>http://github.com/MattHall/bort/commit/ebe3555482a2f249ac7445cd0e3d3f094c7f1256</url>
  <id>ebe3555482a2f249ac7445cd0e3d3f094c7f1256</id>
  <committed-date>2008-08-25T02:51:08-07:00</committed-date>
  <authored-date>2008-08-25T02:51:08-07:00</authored-date>
  <message>Changed authentication to use email instead of username</message>
  <tree>960708146ab8ec491a3d43b56fdb86d3fed56cd6</tree>
  <committer>
    <name>unknown</name>
    <email>Matt@.(none)</email>
  </committer>
</commit>
