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
Hi,
2006/5/6, charbel [email protected]:
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.
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 [email protected] wrote:
hi guys,
–
Jim
2006/5/6, charbel [email protected]:
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.
Beate
Beate P. wrote:
Hi,
2006/5/6, charbel [email protected]:
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.
Beate
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
#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”}