merb_auth_password_sliceはセッションを維持しません
質問
READMEに従って merb_auth_password_slice
を統合すると、 session.authenticated?
はfalseを返しますが、 redirect_after_login
がトリガーされているため、正常にログインできます。
今のところ基本的な認証戦略(パスワードフォーム)を試してみて、うまくいかないようです、何かアイデアはありますか?
私の初期化ファイル:
require 'dm-validations'
dependencies "merb-more", "merb_helpers", "merb-slices", "merb_auth_password_slice"
Merb::BootLoader.before_app_loads do
DataMapper.setup(:default, "sqlite3://config/dev.db")
end
Merb::BootLoader.after_app_loads do
# have already done this
# raise "You must specify a valid openid in Merb.root/config/open_id to use this example app" unless File.exists?(Merb.root / "config" / "open_id")
# # DataMapper.auto_migrate!
# User.create(:login => "admin",
# :password => "password", :password_confirmation => "password",
# :email => "admin@example.com",
# :identity_url => File.read(Merb.root / "config" / "open_id"))
end
Merb::Config.use do |c|
c[:session_secret_key] = 'my key'
c[:session_store] = 'cookie'
end
Setup.rb
class Authentication
def store_user(user)
return nil unless user
user.id
end
def fetch_user(session_info)
User.get(session_info)
end
end # Authentication
解決
# before(nil, :only => [:update, :destroy]) { session.abandon! }
これは、スライスのセッションコントローラーの原因です
所属していません StackOverflow