添加可确定模块设计使用现有的网站 [英] Adding confirmable module to an existing site using Devise

查看:128
本文介绍了添加可确定模块设计使用现有的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用设计的Web应用程序,并希望将可确定模块添加到网站。然而,由于confirmation_token不产生用户无法登录。当点击未收到确认指令?链接标记仍然不产生

I'm using devise for a web app and wanted to add the confirmable module to the site. However, since a confirmation_token isn't generated users can't sign in. When clicking the 'Didn't receive confirmation instructions?' link the token still isn't generated.

确认电子邮件刚刚产生这个链接(注意在url缺乏令牌):

Confirmation email just generates this link (notice the lack of token in the url):

<p><a href="http://localhost:3000/users/confirmation">Confirm my account</a></p>

什么是得到这个工作的最佳方式?

What is the best way to get this to work?

非常感谢,

托尼

Many thanks,
Tony

推荐答案

我在寻找相同的答案。我怀疑,答案可能是数据模型包括每个用户是否被确认。这似乎增加:

I'm looking for the same answer. I suspect the answer may be that the data model includes whether or not each user is confirmed. It appears to add:

confirmation_token,confirmed_at,confirmation_sent_at

此外,可证实的模块出现添加这些方法:

Also, the confirmable module appears to add these methods:

:confirmation_token,:confirmation_token =,:confirmation_token?
  :confirmation_token_change,:confirmation_token_changed?
  :confirmation_token_was,:reset_confirmation_token !,:confirmed_at,
  :confirmed_at =,:confirmed_at?:confirmed_at_change,
  :confirmed_at_changed?:confirmed_at_was,:reset_confirmed_at!
  :confirmation_sent_at,:confirmation_sent_at =,:confirmation_sent_at?
  :confirmation_sent_at_change,:confirmation_sent_at_changed?
  :confirmation_sent_at_was,:reset_confirmation_sent_at

:confirmation_token, :confirmation_token=, :confirmation_token?, :confirmation_token_change, :confirmation_token_changed?, :confirmation_token_was, :reset_confirmation_token!, :confirmed_at, :confirmed_at=, :confirmed_at?, :confirmed_at_change, :confirmed_at_changed?, :confirmed_at_was, :reset_confirmed_at!, :confirmation_sent_at, :confirmation_sent_at=, :confirmation_sent_at?, :confirmation_sent_at_change, :confirmation_sent_at_changed?, :confirmation_sent_at_was, :reset_confirmation_sent_at!

所以,你可以在数据模型层做到这一点。我使用Mongoid,所以我只是写了一个脚本,为每个用户到今天的变化confirmed_at。

So you could do it in the data model layer. I'm using Mongoid, so I just wrote a script that changes confirmed_at for each user to today.

这篇关于添加可确定模块设计使用现有的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆