Forum: Ruby on Rails login generator always give login unsuccessfull

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2996333331a502072a874a9a07ab5c33?d=identicon&s=25 charbel (Guest)
on 2006-05-06 08:19
hi guys,
i just did what it is written in this website to genrate login
http://wiki.rubyonrails.org/rails/pages/HowToQuick...
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
Ad91bce9c9a8c68b6942607e4721f74e?d=identicon&s=25 Beate Paland (Guest)
on 2006-05-06 08:47
(Received via mailing list)
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/HowToQuick...
> 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
B7ae1a166a9f42a2cb7e87fda8f811e2?d=identicon&s=25 Jim mack (Guest)
on 2006-05-06 09:08
(Received via mailing list)
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
2996333331a502072a874a9a07ab5c33?d=identicon&s=25 charbel (Guest)
on 2006-05-06 09:08
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/HowToQuick...
>> 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"}
Ad91bce9c9a8c68b6942607e4721f74e?d=identicon&s=25 Beate Paland (Guest)
on 2006-05-06 09:29
(Received via mailing list)
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.

Beate
2996333331a502072a874a9a07ab5c33?d=identicon&s=25 charbel (Guest)
on 2006-05-06 10:21
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.
>
> Beate

thanks mate
it works
This topic is locked and can not be replied to.