测试After_authentication以实施监狱
身份验证后我有一个自定义的工作流程,我想对其进行测试。
在初始评估器上,我发现了一些
Warden::Manager.after_authentication do |user, auth, _opts|
next unless user.ban?
auth.logout
throw(:warden, :message => "You're currently ban. Impossible to connect")
end
我认为它已读取了整个文档,而没有找到正确的测试方法。有什么想法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了一种方法。并不是那么明显。让我与您分享。
根据源
所以这是我的解决方法。
享受测试!
I finally found a way. Not that obvious. Let me share it with you.
According to the source warden/hooks.rb#L71-L78
So here is my workaround.
Enjoy testing! ????