about2flip
2009-Oct-27 12:19 UTC
Authlogic Password confirmation is too short Error. NEED HELP.
Hi: I am using authlogic, and following railscast tutorial. I am running into this error code with the password confirmation. authlogic password confirmation is too short Has anyone experienced this error? I need your help. Thanks in advance for your help.
Marnen Laibow-Koser
2009-Oct-27 12:39 UTC
Re: Authlogic Password confirmation is too short Error. NEED
about2flip wrote:> Hi: > > I am using authlogic, and following railscast tutorial. I am running > into this error code with the password confirmation. > > authlogic password confirmation is too short > > Has anyone experienced this error? I need your help. > > Thanks in advance for your help.Configure Authlogic with a different minimum password length (check the rdoc for details). Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
about2flip
2009-Oct-27 15:28 UTC
Re: Authlogic Password confirmation is too short Error. NEED
Hi: I read through the rdocs, and I saw the following: def require_password_confirmation(value = nil) rw_config(:require_password_confirmation, value, true) end def validates_length_of_password_field_options(value = nil) rw_config(:validates_length_of_password_field_options, value, {:minimum => 4, :if => :require_password?}) end def validates_length_of_password_confirmation_field_options(value nil) rw_config(:validates_length_of_password_confirmation_field_options, value, validates_length_of_password_field_options) end i put these into my ApplicationController, and it does not seem to be working. It still tells me that my password confirmation is too short. I am pulling out my hair. Any help would be greatly appreciated. Also, I am on XP OS. Thanks Again On Oct 27, 8:39 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> about2flip wrote: > > Hi: > > > I am using authlogic, and following railscast tutorial. I am running > > into this error code with the password confirmation. > > > authlogic password confirmation is too short > > > Has anyone experienced this error? I need your help. > > > Thanks in advance for your help. > > Configure Authlogic with a different minimum password length (check the > rdoc for details). > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Hassan Schroeder
2009-Oct-27 15:48 UTC
Re: Authlogic Password confirmation is too short Error. NEED
On Tue, Oct 27, 2009 at 8:28 AM, about2flip <mnusom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It still tells me that my password confirmation is too short.Then that''s probably because it''s zero-length because you''re not actually passing anything. Typo in login form, maybe? Have you put any debugging statements in your controller to show the value for password confirmation that you think you''re using? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan
Philip Hallstrom
2009-Oct-27 15:51 UTC
Re: Authlogic Password confirmation is too short Error. NEED
On Oct 27, 2009, at 8:28 AM, about2flip wrote:> > Hi: > > I read through the rdocs, and I saw the following: > > def require_password_confirmation(value = nil) > rw_config(:require_password_confirmation, value, true) > end > > def validates_length_of_password_field_options(value = nil) > rw_config(:validates_length_of_password_field_options, value, > {:minimum => 4, :if => :require_password?}) > end > > def validates_length_of_password_confirmation_field_options(value > nil) > rw_config(:validates_length_of_password_confirmation_field_options, > value, validates_length_of_password_field_options) > end > > i put these into my ApplicationController, and it does not seem to be > working. It still tells me that my password confirmation is too short. > I am pulling out my hair.These don''t go in your ApplicationController... they go into the model that you are applying AuthLogic on. The below would change the minimum to 1 character. class User < ActiveRecord::Base acts_as_authentic do |c| c .merge_validates_length_of_password_confirmation_field_options :minimum => 1 end end Unless you have a good reason though requiring at least 4 characters isn''t unreasonable (some would argue you should require more). -philip> Any help would be greatly appreciated. Also, I am on XP OS. > > Thanks Again > > On Oct 27, 8:39 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- > s.net> wrote: >> about2flip wrote: >>> Hi: >> >>> I am using authlogic, and following railscast tutorial. I am running >>> into this error code with the password confirmation. >> >>> authlogic password confirmation is too short >> >>> Has anyone experienced this error? I need your help. >> >>> Thanks in advance for your help. >> >> Configure Authlogic with a different minimum password length (check >> the >> rdoc for details). >> >> Best, >> -- >> Marnen Laibow-Koserhttp://www.marnen.org >> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >> -- >> Posted viahttp://www.ruby-forum.com/. > >
about2flip
2009-Oct-27 16:11 UTC
Re: Authlogic Password confirmation is too short Error. NEED
I don''t require max 4. It is doing it automatically, which is why I am getting pissed off. I don''t have anything set stating that max is 4. On Oct 27, 11:51 am, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> On Oct 27, 2009, at 8:28 AM, about2flip wrote: > > > > > > > Hi: > > > I read through the rdocs, and I saw the following: > > > def require_password_confirmation(value = nil) > > rw_config(:require_password_confirmation, value, true) > > end > > > def validates_length_of_password_field_options(value = nil) > > rw_config(:validates_length_of_password_field_options, value, > > {:minimum => 4, :if => :require_password?}) > > end > > > def validates_length_of_password_confirmation_field_options(value > > nil) > > rw_config(:validates_length_of_password_confirmation_field_options, > > value, validates_length_of_password_field_options) > > end > > > i put these into my ApplicationController, and it does not seem to be > > working. It still tells me that mypasswordconfirmation istooshort. > > I am pulling out my hair. > > These don''t go in your ApplicationController... they go into the model > that you are applyingAuthLogicon. The below would change the > minimum to 1 character. > > class User < ActiveRecord::Base > acts_as_authentic do |c| > > c > .merge_validates_length_of_password_confirmation_field_options > :minimum => 1 > end > end > > Unless you have a good reason though requiring at least 4 characters > isn''t unreasonable (some would argue you should require more). > > -philip > > > Any help would be greatly appreciated. Also, I am on XP OS. > > > Thanks Again > > > On Oct 27, 8:39 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > s.net> wrote: > >> about2flip wrote: > >>> Hi: > > >>> I am usingauthlogic, and following railscast tutorial. I am running > >>> into this error code with thepasswordconfirmation. > > >>>authlogicpasswordconfirmation istooshort > > >>> Has anyone experienced this error? I need your help. > > >>> Thanks in advance for your help. > > >> ConfigureAuthlogicwith a different minimumpasswordlength (check > >> the > >> rdoc for details). > > >> Best, > >> -- > >> Marnen Laibow-Koserhttp://www.marnen.org > >> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > >> -- > >> Posted viahttp://www.ruby-forum.com/.
about2flip
2009-Oct-27 16:28 UTC
Re: Authlogic Password confirmation is too short Error. NEED
I tried what you suggested, and now it''s telling me that password is too short minimum 1. I am putting in 4,5,6 characters. I also put in this: merge_validates_confirmation_of_password_field_options What are the options, I don''t see them in rdoc. Thanks. On Oct 27, 11:51 am, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> On Oct 27, 2009, at 8:28 AM, about2flip wrote: > > > > > > > Hi: > > > I read through the rdocs, and I saw the following: > > > def require_password_confirmation(value = nil) > > rw_config(:require_password_confirmation, value, true) > > end > > > def validates_length_of_password_field_options(value = nil) > > rw_config(:validates_length_of_password_field_options, value, > > {:minimum => 4, :if => :require_password?}) > > end > > > def validates_length_of_password_confirmation_field_options(value > > nil) > > rw_config(:validates_length_of_password_confirmation_field_options, > > value, validates_length_of_password_field_options) > > end > > > i put these into my ApplicationController, and it does not seem to be > > working. It still tells me that mypasswordconfirmation istooshort. > > I am pulling out my hair. > > These don''t go in your ApplicationController... they go into the model > that you are applyingAuthLogicon. The below would change the > minimum to 1 character. > > class User < ActiveRecord::Base > acts_as_authentic do |c| > > c > .merge_validates_length_of_password_confirmation_field_options > :minimum => 1 > end > end > > Unless you have a good reason though requiring at least 4 characters > isn''t unreasonable (some would argue you should require more). > > -philip > > > Any help would be greatly appreciated. Also, I am on XP OS. > > > Thanks Again > > > On Oct 27, 8:39 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > s.net> wrote: > >> about2flip wrote: > >>> Hi: > > >>> I am usingauthlogic, and following railscast tutorial. I am running > >>> into this error code with thepasswordconfirmation. > > >>>authlogicpasswordconfirmation istooshort > > >>> Has anyone experienced this error? I need your help. > > >>> Thanks in advance for your help. > > >> ConfigureAuthlogicwith a different minimumpasswordlength (check > >> the > >> rdoc for details). > > >> Best, > >> -- > >> Marnen Laibow-Koserhttp://www.marnen.org > >> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > >> -- > >> Posted viahttp://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Oct-27 16:29 UTC
Re: Authlogic Password confirmation is too short Error. NEED
about2flip wrote:> I don''t require max 4. It is doing it automatically, which is why I am > getting pissed off. I don''t have anything set stating that max is 4.Right, because Authlogic sets sensible defaults. Just override them as outlined above if you don''t like them. Nothing to get pissed off about. -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Oct-27 16:37 UTC
Re: Authlogic Password confirmation is too short Error. NEED
about2flip wrote:> I tried what you suggested, and now it''s telling me that password is > too short minimum 1. I am putting in 4,5,6 characters. I also put in > this: > > merge_validates_confirmation_of_password_field_options > > What are the options, I don''t see them in rdoc.They''re in the rdoc. Check out the various ActsAsAuthentic::[whatever]::Config modules.> > Thanks.Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
about2flip
2009-Oct-27 17:06 UTC
Re: Authlogic Password confirmation is too short Error. NEED
This is what I am seeing when I submit: Processing UsersController#create (for 127.0.0.1 at 2009-10-27 13:02:52) [POST] Parameters: {"user"=>{"password_confirmation"=>"1234", "username"=>"about2flip ", "password"=>"1234", "email"=>"mnusom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"}, "commit"=>"Submit", "authen ticity_token"=>"+Xtj768EKeR4j+sQ7maJv+ly9wfTD02jRQq4WaJH/zc="} WARNING: Can''t mass-assign these protected attributes: password_confirmation ←[4;35;1mUser Exists (0.0ms)←[0m ←[0mSELECT "users".id FROM "users" WHERE (L OWER("users"."email") = ''mnusom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org'') LIMIT 1←[0m ←[4;36;1mUser Exists (0.0ms)←[0m ←[0;1mSELECT "users".id FROM "users" WHERE (LOWER("users"."username") = ''about2flip'') LIMIT 1←[0m ←[4;35;1mUser Exists (0.0ms)←[0m ←[0mSELECT "users".id FROM "users" WHERE (" users"."persistence_token" ''1208ff98da888d6b012a4eb64283417acf264d4e3baf612219 1c98f05e3dbcf913691b2690dacc928a4b116f189c6c6f4d226aaaf081d2bc9b5d4fa94aabd837'') LIMIT 1←[0m Rendering template within layouts/application Rendering users/new Rendered users/_form (16.0ms) Completed in 187ms (View: 16, DB: 0) | 200 OK [http://localhost/users] What does this mean: WARNING: Can''t mass-assign these protected attributes: thanks On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> about2flip wrote: > > I tried what you suggested, and now it''s telling me thatpasswordis > >tooshortminimum 1. I am putting in 4,5,6 characters. I also put in > > this: > > > merge_validates_confirmation_of_password_field_options > > > What are the options, I don''t see them in rdoc. > > They''re in the rdoc. Check out the various > ActsAsAuthentic::[whatever]::Config modules. > > > > > Thanks. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
about2flip
2009-Oct-27 17:13 UTC
Re: Authlogic Password confirmation is too short Error. NEED
Would it be because of this line in my model: attr_accessible :username, :email, :password thanks On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote:> about2flip wrote: > > I tried what you suggested, and now it''s telling me thatpasswordis > >tooshortminimum 1. I am putting in 4,5,6 characters. I also put in > > this: > > > merge_validates_confirmation_of_password_field_options > > > What are the options, I don''t see them in rdoc. > > They''re in the rdoc. Check out the various > ActsAsAuthentic::[whatever]::Config modules. > > > > > Thanks. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://www.ruby-forum.com/.
Frederick Cheung
2009-Oct-27 17:14 UTC
Re: Authlogic Password confirmation is too short Error. NEED
On 27 Oct 2009, at 17:13, about2flip wrote:> > Would it be because of this line in my model: > > attr_accessible :username, :email, :password >yes - this means that User.create(params[:user]) won''t set username, email or password. Fred> thanks > > > > On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- > s.net> wrote: >> about2flip wrote: >>> I tried what you suggested, and now it''s telling me thatpasswordis >>> tooshortminimum 1. I am putting in 4,5,6 characters. I also put in >>> this: >> >>> merge_validates_confirmation_of_password_field_options >> >>> What are the options, I don''t see them in rdoc. >> >> They''re in the rdoc. Check out the various >> ActsAsAuthentic::[whatever]::Config modules. >> >> >> >>> Thanks. >> >> Best, >> -- >> Marnen Laibow-Koserhttp://www.marnen.org >> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >> -- >> Posted viahttp://www.ruby-forum.com/. > >
about2flip
2009-Oct-27 17:20 UTC
Re: Authlogic Password confirmation is too short Error. NEED
Well I think I fixed it because I see my data saved to the DB table. I just added this: attr_accessible :username, :email, :password, :password_confirmation but I got a controller error: undefined local variable or method `root_url'' for #<UsersController: 0x477b998> will try to figure out. Thanks to all that replied and helped On Oct 27, 1:14 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 27 Oct 2009, at 17:13, about2flip wrote: > > > > > Would it be because of this line in my model: > > > attr_accessible :username, :email, :password > > yes - this means that > > User.create(params[:user]) won''t set username, email orpassword. > > Fred > > > thanks > > > On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas- > > s.net> wrote: > >> about2flip wrote: > >>> I tried what you suggested, and now it''s telling me thatpasswordis > >>> tooshortminimum 1. I am putting in 4,5,6 characters. I also put in > >>> this: > > >>> merge_validates_confirmation_of_password_field_options > > >>> What are the options, I don''t see them in rdoc. > > >> They''re in the rdoc. Check out the various > >> ActsAsAuthentic::[whatever]::Config modules. > > >>> Thanks. > > >> Best, > >> -- > >> Marnen Laibow-Koserhttp://www.marnen.org > >> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > >> -- > >> Posted viahttp://www.ruby-forum.com/. > >
Marnen Laibow-Koser
2009-Oct-27 17:22 UTC
Re: Authlogic Password confirmation is too short Error. NEED
about2flip wrote: [...]> What does this mean: WARNING: Can''t mass-assign these protected > attributes: > > thanksRead about AR::Base.attr_protected and .attr_accessible. I think Authlogic may make the password fields protected by default.> > On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing-l...@andreas-Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Frederick Cheung
2009-Oct-27 17:23 UTC
Re: Authlogic Password confirmation is too short Error. NEED
On 27 Oct 2009, at 17:20, about2flip wrote:> > Well I think I fixed it because I see my data saved to the DB table. I > just added this: > > attr_accessible :username, :email, :password, :password_confirmation >Sorry I got things the wrong way round - attr_accessible means that User.new(params[:user]) will assign them, however when you use attr_accessible any attribute you don''t name is implicitly made attr_protected (which is the thing where they aren''t mass assigned). Fred> but I got a controller error: > > undefined local variable or method `root_url'' for #<UsersController: > 0x477b998> > > will try to figure out. > > Thanks to all that replied and helped > > > > On Oct 27, 1:14 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On 27 Oct 2009, at 17:13, about2flip wrote: >> >> >> >>> Would it be because of this line in my model: >> >>> attr_accessible :username, :email, :password >> >> yes - this means that >> >> User.create(params[:user]) won''t set username, email orpassword. >> >> Fred >> >>> thanks >> >>> On Oct 27, 12:37 pm, Marnen Laibow-Koser <rails-mailing- >>> l...@andreas- >>> s.net> wrote: >>>> about2flip wrote: >>>>> I tried what you suggested, and now it''s telling me thatpasswordis >>>>> tooshortminimum 1. I am putting in 4,5,6 characters. I also put in >>>>> this: >> >>>>> merge_validates_confirmation_of_password_field_options >> >>>>> What are the options, I don''t see them in rdoc. >> >>>> They''re in the rdoc. Check out the various >>>> ActsAsAuthentic::[whatever]::Config modules. >> >>>>> Thanks. >> >>>> Best, >>>> -- >>>> Marnen Laibow-Koserhttp://www.marnen.org >>>> mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >>>> -- >>>> Posted viahttp://www.ruby-forum.com/. >> >> > >
Possibly Parallel Threads
- skip password validation in authlogic
- Image_tag Positioning/Alignment
- RE: We're sorry something went wrong when I use -d mysql
- AuthLogic Question - one time password (persistence_token) - what config is required to use this???
- Authlogic Page View Authentication Help