Devise with Sinatra

前端 未结 4 1326
独厮守ぢ
独厮守ぢ 2021-02-05 07:54

Does anyone had installed Devise gem with Sinatra?

Devise is based on Warden and so it should work on Sinatra, I couldn\'t find any related info about how to implement i

4条回答
  •  悲&欢浪女
    2021-02-05 08:28

    Devise is really just a Rails-centric wrapper with nice helpers for warden, which is the underlying Rack authentication framework. So if you're using Sinatra in conjunction with Rails, you can use Devise in your Rails app, and use warden directly in your Sinatra app, and they will see the same user session data.

    So no, you can't use Devise directly within your Sinatra app, but if you're building a modular app with some pieces in Rails, and other pieces in Sinatra, you can use Devise/Warden among the components.

提交回复
热议问题