# Salted Login Generator glitch

**URL:** <https://www.ruby-forum.com/t/salted-login-generator-glitch/58344>\
**Category:** Rails\
**Created:** [April 20, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/salted-login-generator-glitch/58344 "2006-04-20T18:57:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robtotheb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/db5fbb/32.png) [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Post date:** [April 20, 2006, 6:57pm UTC](https://www.ruby-forum.com/t/salted-login-generator-glitch/58344/1 "2006-04-20T18:57:06Z")

</div>

I followed the tutorial here  
[http://wiki.rubyonrails.com/rails/pages/SaltedLoginGeneratorQuickstart](http://wiki.rubyonrails.com/rails/pages/SaltedLoginGeneratorQuickstart)  
and didn’t have any problems. Actionmailer is working fine. When I  
sign up I get the email saying “Please click on the following link to  
confirm your registration”  
When I do i go to the default page with “Welcome. You are now logged  
into the system…”  
So I thought great, that was easy…

One glitch though. When I went to sign in with my new id and password I  
got the message “Login unsuccessful” I have double checked I didnt make  
a typo and have scanned through the controllers / models etc and can’t  
see where its going wrong. Any ideas?

---

<div class="post-metadata">

**Author:** ![robtotheb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/db5fbb/32.png) [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Post date:** [April 20, 2006, 7:53pm UTC](https://www.ruby-forum.com/t/salted-login-generator-glitch/58344/2 "2006-04-20T19:53:17Z")

</div>

Rob B. wrote:

> I followed the tutorial here  
> [Peak Obsession](http://wiki.rubyonrails.com/rails/pages/SaltedLoginGeneratorQuickstart)  
> and didn’t have any problems. Actionmailer is working fine. When I  
> sign up I get the email saying “Please click on the following link to  
> confirm your registration”  
> When I do i go to the default page with “Welcome. You are now logged  
> into the system…”  
> So I thought great, that was easy…
> 
> One glitch though. When I went to sign in with my new id and password I  
> got the message “Login unsuccessful” I have double checked I didnt make  
> a typo and have scanned through the controllers / models etc and can’t  
> see where its going wrong. Any ideas?

You need to set:  
before\_filter :login\_required

in the UserController.

This sets a database field which is required for login. I had the same  
problem.

---

<div class="post-metadata">

**Author:** ![robtotheb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/db5fbb/32.png) [@robtotheb](https://www.ruby-forum.com/u/robtotheb)\
**Post date:** [April 20, 2006, 10:16pm UTC](https://www.ruby-forum.com/t/salted-login-generator-glitch/58344/3 "2006-04-20T22:16:22Z")

</div>

> You need to set:  
> before\_filter :login\_required
> 
> in the UserController.
> 
> This sets a database field which is required for login. I had the same  
> problem.

Many thanks, problem solved 🙂
