Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将构建一个使用 AJAX 将资源作为 json 加载而不重新加载页面的应用程序,它需要身份验证。
我已经在使用 Devise 处理注册,但是对于每个 ajax 调用,服务器必须确保用户经过身份验证,因此我将使用 Devise 提供的可验证令牌。
现在,在我读过的教程中,作者建议创建一个“令牌”控制器,在用户提供电子邮件和密码后,令牌被创建或销毁,但由于不会有 apis,当用户登录正常方式?(并在用户注销时销毁它?)
你怎么看?有什么建议/例子吗?
这是一个示例http://matteomelani.wordpress.com/2011/10/17/authentication-for-mobile-devices/