Rails 4 devise_invitable invitation token invalid

夙愿已清 提交于 2019-12-04 07:28:16

I'd prefer to comment but I have only 36 points and am not allowed so here's an incomplete answer:

this is the code from devise_invitable InvitationsController which is redirecting your request

def resource_from_invitation_token
  unless params[:invitation_token] && self.resource = resource_class.find_by_invitation_token(params[:invitation_token], true)
    set_flash_message(:alert, :invitation_token_invalid)
    redirect_to after_sign_out_path_for(resource_name)
  end
end

in your rails console try running:

token = '3GXDmi7NntDRdhvo57q5' #the token sent in the invitation email
User.find_by_invitation_token(token, true)

and see if that returns your User. It probably won't but maybe this will bring you closer to an answer. I hope so.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!