lib/gds-sso/warden_config.rb in gds-sso-3.0.5 vs lib/gds-sso/warden_config.rb in gds-sso-3.1.0

- old
+ new

@@ -25,11 +25,11 @@ Warden::Manager.serialize_from_session do |tuple| # This will reject old sessions that don't have an auth_set time uid, auth_set = tuple if auth_set and (auth_set + GDS::SSO::Config.auth_valid_for) > Time.now.utc - GDS::SSO::Config.user_klass.find_by_uid(uid) + GDS::SSO::Config.user_klass.where(:uid => uid).first else nil end end @@ -58,11 +58,11 @@ end end Warden::Strategies.add(:gds_bearer_token) do def valid? - ::GDS::SSO::ApiAccess.api_call?(env) && + ::GDS::SSO::ApiAccess.api_call?(env) && ::GDS::SSO::ApiAccess.oauth_api_call?(env) end def authenticate! logger.debug("Authenticating with gds_bearer_token strategy") @@ -115,10 +115,10 @@ } end def prep_user(auth_hash) user = GDS::SSO::Config.user_klass.find_for_gds_oauth(auth_hash) - custom!(anauthorized) unless user + custom!(unauthorized) unless user user end def unauthorized [