<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -2,13 +2,10 @@ class &lt;%= migration_name %&gt; &lt; ActiveRecord::Migration
   def self.up
     create_table &quot;&lt;%= table_name %&gt;&quot;, :force =&gt; true do |t|
       # Identity
-      t.string   :login,                     :limit =&gt; 40
+      t.string   :identifier,                :limit =&gt; 40
       t.string   :name,                      :limit =&gt; 100, :default =&gt; '', :null =&gt; true
       t.string   :email,                     :limit =&gt; 100
       t.timestamps
-      # for Authentication::ByPassword
-      t.string   :crypted_password,          :limit =&gt; 40
-      t.string   :salt,                      :limit =&gt; 40
       # for Authentication::ByCookieToken
       t.string   :remember_token,            :limit =&gt; 40
       t.datetime :remember_token_expires_at</diff>
      <filename>generators/authenticated/templates/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -15,13 +15,14 @@ class SessionsController &lt; ApplicationController
   def create
     logout_keeping_session!
     begin
-      login_by_password! params[:login], params[:password]
+      #this might be a hack to get an exception thrown but it works for now
+      become_logged_in_as current_user
     rescue Exception =&gt; error
       handle_login_error error
     else # success!
       remember_me_flag = (params[:remember_me] == &quot;1&quot;)
       handle_remember_cookie! remember_me_flag
-      flash[:notice] = &quot;Welcome, #{current_user.login}&quot;
+      flash[:notice] = &quot;Welcome, #{current_user.identifier}&quot;
       redirect_back_or_default('/')
     end
   end</diff>
      <filename>generators/authenticated/templates/sessions_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,13 +1,14 @@
 class &lt;%= class_name %&gt; &lt; ActiveRecord::Base
-  security_components :security_policy,
-    :trustification =&gt; [:email_verification],
-    :identity       =&gt; [:password, :cookie_token, :simple_roles,]
+ # This is not enabled you must add :password to identity to use password authentication
+ # security_components :security_policy,
+ #  :trustification =&gt; [],
+ #  :identity       =&gt; [:password, :cookie_token, :simple_roles]
 
   # Validation constants are in config/initializers/rest_auth_config.rb
-  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_presence_of     :identifier
+  validates_length_of       :identifier,    :within =&gt; 3..40
+  validates_uniqueness_of   :identifier,    :case_sensitive =&gt; false
+  validates_format_of       :identifier,    :with =&gt; RE_LOGIN_OK, :message =&gt; MSG_LOGIN_BAD
 
   validates_length_of       :name,     :maximum =&gt; 100
   validates_format_of       :name,     :with =&gt; RE_NAME_OK,  :message =&gt; MSG_NAME_BAD, :allow_nil =&gt; true
@@ -19,6 +20,6 @@ class &lt;%= class_name %&gt; &lt; ActiveRecord::Base
 
   # prevents a visitor from submitting a crafted form that bypasses activation
   # anything else you want your visitor to change should be added here.
-  attr_accessible :login, :email, :name
+  attr_accessible :identifier, :email, :name
 
 end</diff>
      <filename>generators/authenticated/templates/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,8 +3,8 @@
 
 &lt;%%= error_messages_for :&lt;%= model_name %&gt; %&gt;
 &lt;%% form_for :&lt;%= model_name %&gt;, :url =&gt; &lt;%= model_controller_routing_name %&gt;_path do |f| -%&gt;
-&lt;p&gt;&lt;label for=&quot;login&quot;&gt;Login&lt;/label&gt;&lt;br/&gt;
-&lt;%%= f.text_field :login %&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for=&quot;identifier&quot;&gt;Identifier&lt;/label&gt;&lt;br/&gt;
+&lt;%%= f.text_field :identifier %&gt;&lt;/p&gt;
 
 &lt;p&gt;&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;&lt;br/&gt;
 &lt;%%= f.text_field :email %&gt;&lt;/p&gt;</diff>
      <filename>generators/authenticated/templates/views/signup.html.erb</filename>
    </modified>
    <modified>
      <diff>@@ -8,3 +8,7 @@ end
 # FIXME -- this is crap
 require 'pathname'
 $REST_AUTH_DIR = Pathname.new(File.dirname(__FILE__)).realpath
+
+p &quot;awesome sauce&quot;
+
+#require &quot;vendor/plugins/youser_authentication/generators/authenticated/authenticated_generator&quot;
\ No newline at end of file</diff>
      <filename>init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,12 @@ protected
     user = User.authenticate_by_password login, password
     become_logged_in_as! user
   end
+  
+  #Log in using params
+  #this was created to abstract the login_by_password! call because not all logins are password based
+  def login_from_params
+    login_by_password!(params[:login], params[:password]) if params[:login] &amp;&amp; params[:password]
+  end
 
   #
   # Called from #current_user, attempts to login by basic authentication.
@@ -22,8 +28,9 @@ protected
     end
   end
   # hooks into login chain at lower priority
-  def try_login_chain_with_basic_auth
-    try_login_chain_without_basic_auth || login_from_basic_auth
+  def try_login_chain_with_password
+    p &quot;hi there again&quot;
+    try_login_chain_without_password || login_from_params || login_from_basic_auth
   end
 
   #
@@ -32,7 +39,7 @@ protected
   def self.included recipient
     # Filters :password and :password_confirmation
     recipient.filter_parameter_logging :password if recipient.respond_to? :filter_parameter_logging
-    recipient.alias_method_chain :try_login_chain,  :basic_auth unless recipient.instance_methods.include? 'try_login_chain_without_basic_auth'
+    recipient.alias_method_chain :try_login_chain,  :password unless recipient.instance_methods.include? 'try_login_chain_without_password'
   end
 end
 
@@ -44,17 +51,29 @@ module Identity::Password
     # puts &quot;#{recipient}: including Authentication::ByPassword&quot;
     recipient.extend( ClassMethods )
     recipient.class_eval do
-      attr_accessible :password, :password_confirmation
+      attr_accessible :password, :password_confirmation, :login
       # Virtual attribute for the unencrypted password
-      attr_accessor :password
-      validates_presence_of     :password,                   :if =&gt; :password_validation_required?
-      validates_presence_of     :password_confirmation,      :if =&gt; :password_validation_required?
-      validates_confirmation_of :password,                   :if =&gt; :password_validation_required?
-      validates_length_of       :password, :within =&gt; 6..40, :if =&gt; :password_validation_required?
+      attr_accessor :password, :password_confirmation
+      before_validation :set_login
+      #validates_presence_of     :login,                      :if =&gt; :password_validation_required?
+      #validates_presence_of     :password,                   :if =&gt; :password_validation_required?
+      #validates_presence_of     :password_confirmation,      :if =&gt; :password_validation_required?
+      #validates_confirmation_of :password,                   :if =&gt; :password_validation_required?
+      #validates_length_of       :password, :within =&gt; 6..40, :if =&gt; :password_validation_required?
       before_save :encrypt_password
     end
   end
-
+  
+  #ensures that the login field is set to what it should be
+  def set_login
+    self.login = login_field
+  end
+  
+  #override this in your model if you want to use something other than identity (i.e email)
+  def login_field
+    identifier
+  end
+  
   # Does this password match the user's?
   def password_valid?(plaintext)
     crypted_password == encrypt(plaintext)</diff>
      <filename>lib/authentication/by_password.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ebad734f7fa6f9882335c4c0a49279314c77da7d</id>
    </parent>
  </parents>
  <author>
    <name>Steve Martocci</name>
    <email>smartocci@gmail.com</email>
  </author>
  <url>http://github.com/smartocci/modulr-authentication/commit/0fd56099b06b0d32ee1746e8b5becbde3ba371ab</url>
  <id>0fd56099b06b0d32ee1746e8b5becbde3ba371ab</id>
  <committed-date>2008-08-12T16:40:37-07:00</committed-date>
  <authored-date>2008-08-12T16:40:37-07:00</authored-date>
  <message>updated temploates for password generation split</message>
  <tree>a4b2adf2a806246c3431f1f6db839f8868efb14b</tree>
  <committer>
    <name>Steve Martocci</name>
    <email>smartocci@gmail.com</email>
  </committer>
</commit>
