# Email verifier

**URL:** <https://www.ruby-forum.com/t/email-verifier/120723>\
**Category:** Rails\
**Created:** [November 20, 2007, 2:50am UTC](https://www.ruby-forum.com/t/email-verifier/120723 "2007-11-20T02:50:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jgjgjg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@jgjgjg](https://www.ruby-forum.com/u/jgjgjg)\
**Post date:** [November 20, 2007, 2:50am UTC](https://www.ruby-forum.com/t/email-verifier/120723/1 "2007-11-20T02:50:26Z")

</div>

Hi, we have a “verify email” email that goes to users when they sign  
up. As it is, when they click on the link back to the site, we find  
them by the activation code that is stored on the user and is in the  
url. The problem is, if they’re not logged in, they have to log in  
before they can be activated. We use acts as authenticated for our  
authentication and we’d like the user to be automatically logged in if  
they come in through that link.

I’m not sure how to do that and haven’t been able to find anything on  
it. Any thoughts?

Thanks

J

---

<div class="post-metadata">

**Author:** ![jgjgjg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/22d042/32.png) [@jgjgjg](https://www.ruby-forum.com/u/jgjgjg)\
**Post date:** [November 20, 2007, 3:08am UTC](https://www.ruby-forum.com/t/email-verifier/120723/2 "2007-11-20T03:08:32Z")

</div>

If you are using the before\_filter logged\_in? then use the :except =\>  
[:method\_you\_want\_to\_exclude]. Then in the method, after you have  
verified that they are legit (or whatever you do), set session[:user] =  
to their id. That way, the next time they hit logged\_in? it will find  
their id in the session and look them up, correctly setting  
@current\_user. Just know that by excluding that one method, you are  
effectively removing authentication in it so you must do something  
manually to verify that they are legitimate. It’s application specific  
obviously, but I assume something like verifying that the code they used  
is legit and matches a username or something. Anyway, this should get  
you started.

-Bill

jg wrote:

> Thanks
> 
> J
> 
> >

–  
Sincerely,

William P.
