简体   繁体   中英

Email Verification plugin for rails?

I'd like to verify a user's email address by sending them a verify-email-message. Do you know of a good Rails plugin that they've used or seen?

Since I didn't see anything good via Google, at this point, my thought is:

  1. Add a verified boolean field to the user model. Default false.
  2. After user is added (unverified), combine email with a salt (a secret), and create the sha1 hash of the email/salt combo. The result is the verification.
  3. Send a welcoming / verification email to the user. Email includes a url that has the email address and verification as GET args to a verify action on my server.
  4. The verify action recomputes the verification using the supplied email and checks that the new verification matches the one in the url. If it does, then the User rec for the email is marked 'verified'

Also will provide action to re-send the verification email.

Any comments on the above?

Thanks,

Larry

Devise https://github.com/plataformatec/devise

Confirmable: sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in. Recoverable: resets the user password and sends reset instructions.

Authlogic https://github.com/binarylogic/authlogic

Also take a look at this Stackoverflow thread

Email confirmation in Rails without using any existing authentication gems/plugins

Hope this helped!

Devise是一个令人惊叹的宝石,只需很少的努力即可完成。

Dont know of a plugin, but the Action Mailer guide covers some of what you want to do: http://guides.rubyonrails.org/action_mailer_basics.html

It shouldnt be too hard to build on the Guide example for your exact use case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM