# Login generator always give login unsuccessfull

**URL:** <https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766>\
**Category:** Rails\
**Created:** [May 6, 2006, 8:19am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766 "2006-05-06T08:19:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 8:19am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/1 "2006-05-06T08:19:05Z")

</div>

hi guys,  
i just did what it is written in this website to genrate login  
[http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator](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

---

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 8:47am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/2 "2006-05-06T08:47:30Z")

</div>

Hi,

2006/5/6, charbel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> i just did what it is written in this website to genrate login  
> [http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator](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

---

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 9:08am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/3 "2006-05-06T09:08:36Z")

</div>

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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> hi guys,

–  
Jim

---

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 9:29am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/4 "2006-05-06T09:29:44Z")

</div>

2006/5/6, charbel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> 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

---

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 10:21am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/5 "2006-05-06T10:21:05Z")

</div>

Beate P. wrote:

> 2006/5/6, charbel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > 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

---

<div class="post-metadata">

**Author:** ![charbel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/9dc877/32.png) [@charbel](https://www.ruby-forum.com/u/charbel)\
**Post date:** [May 6, 2006, 9:08am UTC](https://www.ruby-forum.com/t/login-generator-always-give-login-unsuccessfull/59766/6 "2006-05-06T09:08:40Z")

</div>

Beate P. wrote:

> Hi,
> 
> 2006/5/6, charbel [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
> 
> > i just did what it is written in this website to genrate login  
> > [http://wiki.rubyonrails.org/rails/pages/HowToQuicklyDoAuthenticationWithLoginGenerator](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”}
