Rails / Devise:valid_password?方法返回nil [英] Rails/Devise: valid_password? method returns nil
问题描述
在我的应用程序中有两种用户(运动员和用户)。运动员模型扩展了用户模型,常规用户模型为其他类型的用户分配了不同的角色。
In my app there are two kinds of users (Athletes & Users). The Athlete model extends the User model and the regular user model assigns different roles to other kinds of users.
由于某种原因,我的一些用户具有某种角色, valid_password?
方法不起作用。这是针对通过 invitable
devise模块邀请的用户。任何其他人遇到这个?这导致我的应用程序在受邀用户无法登录的情况下无法正常工作
For some reason one some of my users with a certain kind of role, the valid_password?
method is not working. This is for users who have been invited via the invitable
devise module. Any one else run into this? This is causing my app to not work properly where invited users cannot log in
推荐答案
可以通过设置 invite_token
to nil
。
This can be fixed by setting the invitation_token
to nil
.
这篇关于Rails / Devise:valid_password?方法返回nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!