OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/lib/open_project/authentication/strategies/warden/session.rb

32 lines
715 B

module OpenProject
module Authentication
module Strategies
module Warden
##
10 years ago
# Temporary strategy necessary as long as the OpenProject authentication has
# not been unified in terms of Warden strategies and is only locally
# applied to the API v3.
class Session < ::Warden::Strategies::Base
def valid?
session
end
def authenticate!
user = user_id ? User.find(user_id) : User.anonymous
success! user
end
def user_id
Hash(session)['user_id']
end
def session
env['rack.session']
end
end
end
end
end
end