hi guys, i just did what it is written in this website to genrate login http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator at the end i add to the database login and password but when i tried to login it give me login unsuccessfull can anyone help me thanks notice: i m beginner in webdeveloppement and especially ruby on rails -- Posted via http://www.ruby-forum.com/.
Beate Paland
2006-May-06 06:45 UTC
[Rails] login generator always give login unsuccessfull
Hi, 2006/5/6, charbel <onlyalaa@gmail.com>:> i just did what it is written in this website to genrate login > http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator > at the end i add to the database login and password > but when i tried to login it give me login unsuccessfullyou can''t create a user over the database, because LoginGenerater uses a salt. Have a look at your login-model, there is sth like this: # Please change the salt to something else, # Every application should use a different one @@salt = ''something'' So you have to create an accout via signup, then the salt is included. Beate
On thing that helped me with logins and understanding the salting/encryption: ''tail'' (monitor the end of) the log\development.log file. Tail on *nix is a command, in windows you can tell radrails to tail the file, or just open the file & look at the end. Look for lines like: Parameters: {"commit"=>"Edit", "action"=>"update", "id"=>"2", "controller"=>"agents", "agent"=>{"name"=>"John", "phones"=>"Cell: 123\r\nWork: 466d", "password"=>"3624818282751adcb57f715c54bde0f1fe117534"}} if you see Parameters: {"commit"=>"Sign in", "action"=>"login", "controller"=>"agents", "password"=>"secret", "agent"=>"soso"} then you aren''t doing something to the password to encrypt it. On 5/5/06, charbel <onlyalaa@gmail.com> wrote:> > hi guys, >-- Jim -- Welcome to the ownership society. If you have not been assigned an owner yet, please report to Iran for duty. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060506/eb0c2edb/attachment.html
Beate Paland wrote:> Hi, > > 2006/5/6, charbel <onlyalaa@gmail.com>: > >> i just did what it is written in this website to genrate login >> http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator >> at the end i add to the database login and password >> but when i tried to login it give me login unsuccessfull > > you can''t create a user over the database, because LoginGenerater uses a > salt. > Have a look at your login-model, there is sth like this: > > # Please change the salt to something else, > # Every application should use a different one > @@salt = ''something'' > > So you have to create an accout via signup, then the salt is included. > > Beatei just tried to add user through signup but when i always get this error NoMethodError in AccountController#signup undefined method `redirect_back_or_default'' for #<AccountController:0x394b018> RAILS_ROOT: ./script/../config/.. Request Parameters: {"user"=>{"password_confirmation"=>"qwer1234", "login"=>"abcdefgh", "password"=>"qwer1234"}} Show session dump --- user: !ruby/object:User attributes: id: "7" password: fe964d422611d1f63a5e4b648c8118cba1d3f30c login: abcdefgh flash: !map:ActionController::Flash::FlashHash notice: Signup successful Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} -- Posted via http://www.ruby-forum.com/.
Beate Paland
2006-May-06 07:28 UTC
[Rails] Re: login generator always give login unsuccessfull
2006/5/6, charbel <onlyalaa@gmail.com>:> i just tried to add user through signup but when i always get this error > NoMethodError in AccountController#signup > undefined method `redirect_back_or_default'' forcomment it out, you don''t need this. Instead write redirect_to :action => ''list'' or sth like this. Beate
charbel
2006-May-06 08:21 UTC
[Rails] Re: Re: login generator always give login unsuccessfull
Beate Paland wrote:> 2006/5/6, charbel <onlyalaa@gmail.com>: >> i just tried to add user through signup but when i always get this error >> NoMethodError in AccountController#signup >> undefined method `redirect_back_or_default'' for > > comment it out, you don''t need this. Instead write > redirect_to :action => ''list'' > or sth like this. > > Beatethanks mate it works -- Posted via http://www.ruby-forum.com/.