gpt4 book ai didi

ruby-on-rails - 注册 Security Extension for Devise (RoR) 时错误 "mail has already been taken"显示两次

转载 作者:行者123 更新时间:2023-12-03 00:41:48 28 4
gpt4 key购买 nike

我正在使用具有安全扩展功能的设备来验证强密码。

当我尝试使用已被占用的电子邮件注册帐户时,我在错误哈希中两次收到错误“电子邮件已被占用”。

我的用户模型如下所示:

class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
# :trackable deleted
devise :database_authenticatable, :registerable, :secure_validatable

# Setup accessible (or protected) attributes for your model
attr_accessible :email, :firstname, :lastname, :password, :password_confirmation, :remember_me
end

如果没有安全扩展(:validatable 而不是 :secure_validatable),我只会收到一次错误。

我做错了什么?

<小时/>

附注奖金问题:

首先如何防止出现某些错误?我是否必须操作设备的 RegistrationsController 或者是否有一个选项?

最佳答案

关于ruby-on-rails - 注册 Security Extension for Devise (RoR) 时错误 "mail has already been taken"显示两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14470607/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com