Rails和DocRaptor,覆盖身份验证

时间:2015-06-13 23:31:40

标签: ruby-on-rails devise

我使用Rails 4和DocRaptor将html页面转换为pdf。 问题是我还使用设计3进行身份验证。

如果您未经过身份验证,则设计的登录页面是根目录。因此,当DocRaptor从显示页面中提取html时,它实际上会拉入登录页面。

是否有办法忽略DocRaptor对呼叫的身份验证?

谢谢!

1 个答案:

答案 0 :(得分:3)

您可以使用skip_before_filter轻松完成此操作,甚至可以向我们传递某种秘密令牌,以防止/模糊公共访问。以下答案有几个很好的例子。作为DocRaptor员工,乐意为您提供帮助!

rails 3: using devise for authentication, how to ALSO allow access to a report page with a guid instead of login

What is the best way to bypass devise authorization for a specific record marked public